135件ヒット
[101-135件を表示]
(0.083秒)
ライブラリ
- ビルトイン (135)
検索結果
-
File
# size -> Integer (14.0) -
ファイルのサイズを返します。
...ファイルのサイズを返します。
//emlist[例][ruby]{
File.open("/dev/null") do |f|
f.size #=> 0
end
//}
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX 失敗した場合に発生します。
@see File#lstat... -
File
# truncate(length) -> 0 (14.0) -
ファイルのサイズを最大 length バイトにします。
...が発生します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX サイズの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.open("testfile", "a") do |f|
f.trun... -
File
# path -> String (8.0) -
オープン時に使用したパスを文字列で返します。
...raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.......open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
File
# to _ path -> String (8.0) -
オープン時に使用したパスを文字列で返します。
...raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.......open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...