るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Thread::SizedQueue#close -> self (21164.0)

キューを close します。詳しくは Thread::Queue#close を参照してください。

...ーを close します。詳しくは Thread::Queue#close を参照してください。

T
hread::Queue とはキューにオブジェクトを追加するスレッドの動作が
異なります。キューにオブジェクトを追加するスレッドを待機している場合は
Close
dQueueErr...
...or が発生して中断されます。

//emlist[例][ruby]{
q = SizedQueue.new(4)

[:resource1, :resource2, :resource3, nil].each { |r| q.push(r) }

q.closed? # => false
q.close
q.closed? # => true
//}

@
see Thread::Queue#close...

IO#close_write -> nil (12278.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" # =...
...> IOError: not opened for writing
end
//}

@
see IO#close, IO#closed?, IO#close_read...
...用の IO を close します。

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

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

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

//emlist[例][ruby]{
f = IO.po...
...pen("/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#autoclose? -> bool (12235.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=...

File#atime -> Time (6237.0)

最終アクセス時刻を Time オブジェクトとして返します。

...刻を Time オブジェクトとして返します。

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

@
raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |...
...f| f.atime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#ctime, File#mtime...
...f| f.atime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#ctime, File#mtime, File#birthtime...

File#ctime -> Time (6237.0)

状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。

... Time オブジェクトとして返します。状態の変更とは chmod などによるものです。

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

@
raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{...
...IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#mtime...
...IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#mtime, File#birthtime...

絞り込み条件を変える

File#lstat -> File::Stat (6237.0)

ファイルの状態を含む File::Stat オブジェクトを生成して返します。 シンボリックリンクに関してリンクそのものの情報を返します。 lstat(2) を実装していないシステムでは、IO#statと同じです。

...File::Stat オブジェクトを生成して返します。
シンボリックリンクに関してリンクそのものの情報を返します。
lstat(2) を実装していないシステムでは、IO#statと同じです。

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

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

//emlist[例][ruby]{
# testlink は testfile のシンボリックリンク
File.open("testlink") do |f|
p f.lstat == File.stat("testfile") # => false
p f.stat == File.stat("testfile") # => true
end
//}

@
see IO#stat, File.stat, File.lsta...
...t...

File#mtime -> Time (6237.0)

最終更新時刻を Time オブジェクトとして返します。

...刻を Time オブジェクトとして返します。

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

@
raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |...
...f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#ctime...
...f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#ctime, File#birthtime...

IO#stat -> File::Stat (6237.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...

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

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

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

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

@
param arg cmd に対す...
...ntl(2) に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の場合には 0を、true の場合には 1 を渡します。

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

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

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

IO.write("testfile", "abcde")
# ファイル状態フラグを読み出す
File.open("testfile") do |f|
f.fcntl(Fcntl::F_GETFL, 0) # => 0
f.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK) # => 0
f.fcntl(Fcntl:...
<< 1 2 3 ... > >>