るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io each_line
  5. io readlines

ライブラリ

キーワード

検索結果

File.size(path) -> Integer (54373.0)

FileTest.#size と同じです。

...
File
Test.#size と同じです。

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

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

FileTest.#size? と同じです。

...
File
Test.#size? と同じです。

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

File#truncate(length) -> 0 (40.0)

ファイルのサイズを最大 length バイトにします。

...書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX サイズの変更に失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File
.open("testfile", "a") do |f|
f.truncate(5) # => 0
f.size # => 5
end
//}...

File.truncate(path, length) -> 0 (40.0)

path で指定されたファイルのサイズを最大 length バイト にします。

...す文字列を指定します。

@param length 変更したいサイズを整数で与えます。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File
.truncate("testfile", 5) # => 0
File
.size("testfile") # => 5
//}...