るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

ライブラリ

キーワード

検索結果

File#path -> String (14.0)

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

...字列で返します。

パスは self に対応するファイルを指しているとは限りません。
たとえば、ファイルが移動されていたり、削除されていたりする場合です。

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

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

...字列で返します。

パスは self に対応するファイルを指しているとは限りません。
たとえば、ファイルが移動されていたり、削除されていたりする場合です。

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