るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.120秒)

別のキーワード

  1. _builtin constants
  2. module constants
  3. constants pf_atm
  4. constants null
  5. constants creat

ライブラリ

クラス

検索結果

File#path -> String (18127.0)

オープン時に使用したパスを文字列で返します。

...削除されていたり、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
F...
...ile.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...
...

@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 (6127.0)

オープン時に使用したパスを文字列で返します。

...削除されていたり、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
F...
...ile.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...
...

@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?)
//}...