るりまサーチ

最速Rubyリファレンスマニュアル検索!
252件ヒット [1-100件を表示] (0.061秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

IO#close -> nil (18163.0)

入出力ポートをクローズします。

...例外 IOError が発生しま
す。ガーベージコレクトの際にはクローズされていない IO ポートはクロー
ズされます。
self がパイプでプロセスにつながっていれば、そのプロセスの終
了を待ち合わせます。


@
raise Errno::EXXX close...
...
@
raise IOError 既に close されていた場合に発生します。

//emlist[例][ruby]{
IO
.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているので read できない)
//}

@
see IO#closed?, IO#close_read, IO#close...
...うと例外 IOError が発生しま
す。ガーベージコレクトの際にはクローズされていない IO ポートはクロー
ズされます。
self がパイプでプロセスにつながっていれば、そのプロセスの終
了を待ち合わせます。

既に close されて...
...

@
raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
IO
.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているので read できない)
//}

@
see IO#closed?, IO#close_read, IO#close_w...

IO#close_read -> nil (6173.0)

読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。

... IO close します。主にパイプや読み書き両用に作成し
IO オブジェクトで使用します。

既に close されていた場合には単に無視されます。

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

@
raise...
...Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
IO
.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end
//}

@
see IO#close, IO#closed?, IO#close_write...

IO#close_write -> nil (6173.0)

書き込み用の IO を close します。

... IO close します。

既に close されていた場合には単に無視されます。

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

@
raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
f = IO.popen...
...("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writing
end
//}

@
see IO#close, IO#closed?, IO#close_read...

IO#close_read -> nil (6167.0)

読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。

...読み込み用の IO close します。主にパイプや読み書き両用に作成し
IO オブジェクトで使用します。


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

@
raise Errno::EXXX close に失敗した場合に発生し...
...ます。

//emlist[例][ruby]{
IO
.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end
//}

@
see IO#close, IO#closed?, IO#close_write...

IO#close_write -> nil (6167.0)

書き込み用の IO を close します。

... IO close します。


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

@
raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOEr...
...ror: not opened for writing
end
//}

@
see IO#close, IO#closed?, IO#close_read...

絞り込み条件を変える

IO#closed? -> bool (6150.0)

self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。 そうでない場合は false を返します。

...t[例][ruby]{
IO
.write("testfile", "test")
f = File.new("testfile")
f.close # => nil
f.closed? # => true
f = IO.popen("/bin/sh","r+")
f.close_write # => nil
f.closed? # => false
f.close_read # => nil
f.closed? # => true
//}

@
see IO#close, IO#close_read, IO#close_write...

IO#autoclose? -> bool (6130.0)

auto-close フラグを返します。

...auto-close フラグを返します。

//emlist[例][ruby]{
IO
.open(IO.sysopen("testfile")) do |io|
io
.autoclose? # => true
io
.autoclose = false
io
.autoclose? # => false
end
//}

@
see IO#autoclose=...

IO#reopen(path) -> self (47.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...ぎます。
IO
#pos, IO#lineno などはリセットされます。

@
param path パスを表す文字列を指定します。

@
param mode パスを開く際のモードを文字列で指定します。

@
raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO
.write("test...
...int("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@
see Kernel.#open...

IO#reopen(path, mode) -> self (47.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...ぎます。
IO
#pos, IO#lineno などはリセットされます。

@
param path パスを表す文字列を指定します。

@
param mode パスを開く際のモードを文字列で指定します。

@
raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO
.write("test...
...int("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@
see Kernel.#open...

IO#fcntl(cmd, arg = 0) -> Integer (38.0)

IOに対してシステムコール fcntl を実行します。 機能の詳細は fcntl(2) を参照してください。 fcntl(2) が返した整数を返します。

...
IO
に対してシステムコール fcntl を実行します。
機能の詳細は fcntl(2) を参照してください。
fcntl(2) が返した整数を返します。

@
param cmd IO に対するコマンドを、添付ライブラリ fcntl が提供している定数で指定します。

@
param...
...は 0を、true の場合には 1 を渡します。

@
raise Errno::EXXX fcntl の実行に失敗した場合に発生します。

@
raise IOError 既に close されている場合に発生します。

//emlist[例][ruby]{
require "fcntl"

IO
.write("testfile", "abcde")
# ファイル状態フラ...

絞り込み条件を変える

IO#stat -> File::Stat (32.0)

ファイルのステータスを含む File::Stat オブジェクトを生成して 返します。

...:Stat オブジェクトを生成して
返します。

@
raise Errno::EXXX ステータスの読み込みに失敗した場合に発生します。

@
raise IOError 既に close されていた場合に発生します。

//emlist[例][ruby]{
IO
.write("testfile", "This is line one\nThis is line two...
...\n")
File.open("testfile") do |f|
s = f.stat
"%o" % s.mode # => "100644"
s.blksize # => 4096
s.atime # => 2018-03-01 23:19:59 +0900
end
//}

@
see File#lstat, File.stat, File.lstat...
<< 1 2 3 > >>