るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.015秒)
トップページ > クラス:File[x] > バージョン:2.1.0[x] > 種類:特異メソッド[x] > クエリ:truncate[x]

別のキーワード

  1. _builtin truncate
  2. bigdecimal truncate
  3. csv truncate
  4. file truncate
  5. stringio truncate

ライブラリ

検索結果

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

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

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

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

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

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