るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.180秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:n[x] > クエリ:a[x] > クエリ:size[x] > クラス:File::Stat[x]

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. rsa n
  4. openssl n
  5. openssl n=

ライブラリ

キーワード

検索結果

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

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

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

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

File::Stat#size? -> Integer | nil (9221.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 (9202.0)

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

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

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