るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.040秒)
トップページ > クエリ:Integer[x] > クラス:File::Stat[x] > クエリ:size[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer times
  5. integer new

ライブラリ

キーワード

検索結果

File::Stat#size -> Integer (18209.0)

ファイルサイズ(バイト単位)を返します。

...ファイルサイズ(バイト単位)を返します。

//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.size #=> 1548
//}...

File::Stat#size? -> Integer | nil (6221.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::Stat#blksize -> Integer (6202.0)

望ましいI/Oのブロックサイズを返します。

...望ましいI/Oのブロックサイズを返します。

//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.blksize #=> nil
//}...