るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file ctime
  4. file atime

ライブラリ

キーワード

検索結果

FileTest.#size(file) -> Integer (21233.0)

ファイルのサイズを返します。

...す。

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise Errno::EXXX file が存在しない場合、あるいはシステムコールに失敗した場合に発生します。

@raise IOError 指定された IO オブジェクト file が既に clo...
...se されていた場合に発生します。

@see FileTest.#size?, FileTest.#zero?

例:
FileTest
.size('/etc/passwd') # => 5925...

FileTest.#size?(file) -> Integer | nil (9239.0)

ファイルのサイズを返します。ファイルが存在しない時や ファイルのサイズが0の時には nil を返します。

...m file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "test")
FileTest
.size?("testfile") # => 4
File
....
...delete("testfile")
FileTest
.size?("testfile") # => nil
//}

@see FileTest.#size, FileTest.#zero?...

FileTest.#empty?(file) -> bool (3127.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...します。

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest
.zero?("zero.txt")...
...# => true
IO.write("nonzero.txt", "1")
FileTest
.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

FileTest.#zero?(file) -> bool (3127.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...します。

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest
.zero?("zero.txt")...
...# => true
IO.write("nonzero.txt", "1")
FileTest
.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...