るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.139秒)
トップページ > バージョン:2.3.0[x] > クエリ:_builtin[x] > クエリ:p[x] > クエリ:size?[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

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

FileTest.#size? と同じです。

FileTest.#size? と同じです。

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

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

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

サイズが0の時には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
//}