るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.062秒)
トップページ > クエリ:Integer[x] > クエリ:on[x] > クラス:IO[x] > クエリ:write[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer new
  5. integer downto

ライブラリ

検索結果

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

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

...ます。
詳しくは IO.open を見てください。

@param path ファイル名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置
@param opts ファイルを開くときのキーワード引数

//emlist[例][ruby]{
text = "This is line one\nThis is line two\nT...
...is is line three\nAnd so on...\n"
IO
.write("testfile", 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.write(path, string, offset=nil, **opts) -> Integer (18235.0)

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

...ます。
詳しくは IO.open を見てください。

@param path ファイル名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置
@param opts ファイルを開くときのキーワード引数

//emlist[例][ruby]{
text = "This is line one\nThis is line two\nT...
...is is line three\nAnd so on...\n"
IO
.write("testfile", 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#write_nonblock(string, exception: true) -> Integer | :wait_writable (12437.0)

IO をノンブロッキングモードに設定し、string を write(2) システムコールで書き出します。

...
IO
をノンブロッキングモードに設定し、string を write(2) システムコールで書き出します。

write
(2) が成功した場合、書き込んだ長さを返します。
EAGAIN, EINTR などは例外 Errno::EXXX として呼出元に報告されます。

書き込んだバ...
...ブジェクトに IO::WaitWritable が Object#extend
されます。よって IO::WaitWritable を write_nonblock のリトライが必要
かの判定に用いることができます。

@param string 自身に書き込みたい文字列を指定します。

@param exception false を指定す...
...込み時に Errno::EAGAIN、Errno::EWOULDBLOCK が発生
する代わりに :wait_writable を返します。

@raise IOError 自身が書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX write(2) が失敗した場合に発生します。...