るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

ライブラリ

キーワード

検索結果

File#path -> String (313.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"
File
.open("/tmp", File::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...

File#to_path -> String (313.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"
File
.open("/tmp", File::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...