5件ヒット
[1-5件を表示]
(0.026秒)
種類
- 特異メソッド (3)
- インスタンスメソッド (2)
検索結果
先頭5件
-
File
# size -> Integer (81367.0) -
ファイルのサイズを返します。
...ファイルのサイズを返します。
//emlist[例][ruby]{
File.open("/dev/null") do |f|
f.size #=> 0
end
//}
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX 失敗した場合に発生します。
@see File#lstat... -
File
. size(path) -> Integer (81361.0) -
FileTest.#size と同じです。
...
FileTest.#size と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. size?(path) -> Integer | nil (45361.0) -
FileTest.#size? と同じです。
...
FileTest.#size? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
File
. truncate(path , length) -> 0 (27064.0) -
path で指定されたファイルのサイズを最大 length バイト にします。
...す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.truncate("testfile", 5) # => 0
File.size("testfile") # => 5
//}... -
File
# truncate(length) -> 0 (27046.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
//}...