るりまサーチ

最速Rubyリファレンスマニュアル検索!
99件ヒット [1-99件を表示] (0.027秒)
トップページ > クエリ:nil[x] > クエリ:binwrite[x]

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. _builtin nil
  5. object nil

ライブラリ

クラス

キーワード

検索結果

Pathname#binwrite(string, offset=nil) -> Integer (18224.0)

IO.binwrite(self.to_s, *args)と同じです。

...IO.binwrite(self.to_s, *args)と同じです。


@see IO.binwrite...

IO.binwrite(path, string, offset=nil) -> Integer (18220.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...0d 49 48 44 52

# binwriteを使用した場合: どの環境でも正しく保存できる。
IO.binwrite('white.binmode.png', png)
puts IO.binread('white.binmode.png', 16).unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52

# binwriteを使用しな...

IO.write(path, string, offset=nil, **opts) -> Integer (107.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...text) # => 66
IO.write("testfile", "0123456789", 20) #=> 10
IO.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO.write("testfile", "0123456789") #=> 10
IO.read("testfile") # => "0123456789"
//}

@see IO.binwrite...

IO.for_fd(fd, mode = "r", **opts) -> IO (12.0)

オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。

...別名です。
* :internal_encoding 内部エンコーディング。"-" はデフォルト内部エンコーディングの
別名です。nilなら変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を...
...e"))
io.class # => IO
io.close
//}

//emlist[例:IO.for_fd による読み込み・バイナリモードでのファイルオープン][ruby]{
IO.binwrite("testfile", "\xBF\xAA\x16\x04.\b\xCB\x12\xACoeQ\xFDv2\xCF9+\x81\x18")
io = IO.for_fd(IO.sysopen("testfile"), "r", binmode: true)
io.class # => IO...

IO.new(fd, mode = "r", **opts) -> IO (12.0)

オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。

...別名です。
* :internal_encoding 内部エンコーディング。"-" はデフォルト内部エンコーディングの
別名です。nilなら変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を...
...e"))
io.class # => IO
io.close
//}

//emlist[例:IO.for_fd による読み込み・バイナリモードでのファイルオープン][ruby]{
IO.binwrite("testfile", "\xBF\xAA\x16\x04.\b\xCB\x12\xACoeQ\xFDv2\xCF9+\x81\x18")
io = IO.for_fd(IO.sysopen("testfile"), "r", binmode: true)
io.class # => IO...

絞り込み条件を変える

IO.open(fd, mode = "r", **opts) -> IO (12.0)

オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。

...別名です。
* :internal_encoding 内部エンコーディング。"-" はデフォルト内部エンコーディングの
別名です。nilなら変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を...
...e"))
io.class # => IO
io.close
//}

//emlist[例:IO.for_fd による読み込み・バイナリモードでのファイルオープン][ruby]{
IO.binwrite("testfile", "\xBF\xAA\x16\x04.\b\xCB\x12\xACoeQ\xFDv2\xCF9+\x81\x18")
io = IO.for_fd(IO.sysopen("testfile"), "r", binmode: true)
io.class # => IO...

IO.open(fd, mode = "r", **opts) {|io| ... } -> object (12.0)

オープン済みのファイルディスクリプタ fd に対する新しい IO オブジェクトを生成して返します。

...別名です。
* :internal_encoding 内部エンコーディング。"-" はデフォルト内部エンコーディングの
別名です。nilなら変換しません。
* :encoding "extenc:intenc" の形で外部/内部エンコーディングを指定します。
* :textmode 真を...
...e"))
io.class # => IO
io.close
//}

//emlist[例:IO.for_fd による読み込み・バイナリモードでのファイルオープン][ruby]{
IO.binwrite("testfile", "\xBF\xAA\x16\x04.\b\xCB\x12\xACoeQ\xFDv2\xCF9+\x81\x18")
io = IO.for_fd(IO.sysopen("testfile"), "r", binmode: true)
io.class # => IO...

NEWS for Ruby 2.1.0 (12.0)

NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...数の虚部が有理数になる
42ri # => Complex(0, 42r)
3.14ri # => Complex(0, 3.14r)
//}

* def によるメソッド定義式は nil の代わりにメソッド名をシンボルで返します

=== 組み込みクラスの更新

* Array
* 追加: Array#to_h キーと値の...
...同じ名前を使うことをサポートしました (Set-Cookieのように)

* Pathname
* 追加: Pathname#write
* 追加: Pathname#binwrite

* rake
* 10.1.0 に更新しました。古い名前空間を削除しました。また、古い rake の機能も削除しました。...

IO.write(path, string, **opts) -> Integer (7.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...text) # => 66
IO.write("testfile", "0123456789", 20) #=> 10
IO.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO.write("testfile", "0123456789") #=> 10
IO.read("testfile") # => "0123456789"
//}

@see IO.binwrite...