るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.027秒)
トップページ > クエリ:nil[x] > クエリ:at[x] > クエリ:size?[x]

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. csv values_at

ライブラリ

クラス

検索結果

File::Stat#size? -> Integer | nil (21236.0)

サイズが0の時にはnil、それ以外の場合はファイルサイズを返します。

...にはnil、それ以外の場合はファイルサイズを返します。

//emlist[][ruby]{
require 'tempfile'

fp = Tempfile.new("temp")
p fp.size #=> 0
p File::Stat.new(fp.path).size? #=> nil
fp.print "not 0 "
fp.close
p FileTest.exist?(fp.path) #=> true
p File::Stat.new(fp.path).size? #=> 6
//...

File.size?(path) -> Integer | nil (18301.0)

FileTest.#size? と同じです。

...FileTest.#size? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...