るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.140秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:_builtin[x] > バージョン:2.6.0[x] > クエリ:E[x] > クエリ:print[x] > クエリ:size?[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix rank_e
  4. open3 capture2e
  5. matrix determinant_e

クラス

検索結果

File::Stat#size? -> Integer | nil (96667.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
//}