別のキーワード
クラス
-
Enumerator
:: Lazy (24) - File (24)
-
File
:: Stat (504) - IO (24)
-
Process
:: Status (180) - Random (12)
- SystemExit (12)
- Thread (33)
キーワード
- & (12)
- <=> (12)
- == (12)
- >> (12)
-
abort
_ on _ exception= (12) - atime (12)
- birthtime (12)
- blksize (12)
- blockdev? (12)
- blocks (12)
- chardev? (12)
- chown (12)
- chunk (12)
- coredump? (12)
- ctime (12)
- dev (12)
-
dev
_ major (12) -
dev
_ minor (12) - directory? (12)
- executable? (12)
-
executable
_ real? (12) - exited? (12)
- exitstatus (12)
- file? (12)
- ftype (12)
- gid (12)
- grpowned? (12)
- ino (12)
- inspect (12)
- lstat (12)
- mode (12)
- mtime (12)
- nlink (12)
- owned? (12)
- pid (12)
- pipe? (12)
- rdev (12)
-
rdev
_ major (12) -
rdev
_ minor (12) - readable? (12)
-
readable
_ real? (12) -
report
_ on _ exception= (9) - setgid? (12)
- setuid? (12)
- signaled? (12)
- size (12)
- size? (12)
-
slice
_ before (12) - socket? (12)
- state (12)
- status (24)
- sticky? (12)
- stopped? (12)
- stopsig (12)
- success? (12)
- symlink? (12)
- sync= (12)
- termsig (12)
-
to
_ i (12) -
to
_ s (12) - uid (12)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - zero? (12)
検索結果
先頭5件
-
IO
# stat -> File :: Stat (18233.0) -
ファイルのステータスを含む File::Stat オブジェクトを生成して 返します。
...ファイルのステータスを含む File::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... -
Process
:: Status # exitstatus -> Integer | nil (9103.0) -
exited? が真の場合プロセスが返した終了ステータスの整数を、そ うでない場合は nil を返します。
exited? が真の場合プロセスが返した終了ステータスの整数を、そ
うでない場合は nil を返します。 -
File
# lstat -> File :: Stat (6266.0) -
ファイルの状態を含む File::Stat オブジェクトを生成して返します。 シンボリックリンクに関してリンクそのものの情報を返します。 lstat(2) を実装していないシステムでは、IO#statと同じです。
...ファイルの状態を含む File::Stat オブジェクトを生成して返します。
シンボリックリンクに関してリンクそのものの情報を返します。
lstat(2) を実装していないシステムでは、IO#statと同じです。
@raise Errno::EXXX 失敗した場合......ose されている場合に発生します。
//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.lstat... -
Random
# state -> Integer (6103.0) -
C言語レベルで定義されている構造体MTの状態を参照します。詳しくはrandom.c を参照してください。
C言語レベルで定義されている構造体MTの状態を参照します。詳しくはrandom.c を参照してください。 -
SystemExit
# status -> Integer (6103.0) -
例外オブジェクトに保存された終了ステータスを返します。
...します。
終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。
例:
begin
exit 1
rescue SystemExit => err
p err.status # => 1
end
begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end... -
Thread
# status -> String | false | nil (6103.0) -
生きているスレッドの状態を文字列 "run"、"sleep", "aborting" のいず れかで返します。正常終了したスレッドに対して false、例外によ り終了したスレッドに対して nil を返します。
...hread.new { sleep }
d.kill #=> #<Thread:0x401b3678 aborting>
a.status #=> nil
b.status #=> "sleep"
c.status #=> false
d.status #=> "aborting"
Thread.current.status #=> "run"
@see Thread#alive?, Thread#stop?... -
File
:: Stat # <=>(o) -> Integer | nil (3039.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...::Stat のインスタンスを指定します。
//emlist[][ruby]{
require 'tempfile' # for Tempfile
fp1 = Tempfile.open("first")
fp1.print "古い方\n"
sleep(1)
fp2 = Tempfile.open("second")
fp2.print "新しい方\n"
p File::Stat.new(fp1.path) <=> File::Stat.new(fp2.path) #=> -1
p File::Stat.......new(fp2.path) <=> File::Stat.new(fp1.path) #=> 1
p File::Stat.new(fp1.path) <=> fp2.path #=> nil
//}... -
File
:: Stat # birthtime -> Time (3027.0) -
作成された時刻を返します。
...44, "testfile")
sleep 10
File.read("testfile")
File.stat("testfile").birthtime #=> 2014-02-24 11:19:17 +0900
File.stat("testfile").mtime #=> 2014-02-24 11:19:27 +0900
File.stat("testfile").ctime #=> 2014-02-24 11:19:37 +0900
File.stat("testfile").atime #=> 2014-02-24 11:19:47 +09... -
File
:: Stat # symlink? -> false (3025.0) -
シンボリックリンクである時に真を返します。 ただし、File::Statは自動的にシンボリックリンクをたどっていくので 常にfalseを返します。
...す。
ただし、File::Statは自動的にシンボリックリンクをたどっていくので
常にfalseを返します。
//emlist[][ruby]{
require 'fileutils'
outfile = $0 + ".ln"
FileUtils.ln_s($0, outfile)
p File::Stat.new(outfile).symlink? #=> false
p File.lstat(outfile).symlink? #=>......true
p FileTest.symlink?(outfile) #=> true
//}
@see File.lstat...