るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.022秒)
トップページ > クエリ:~[x] > バージョン:2.6.0[x] > クエリ:expand_path[x] > クラス:File[x]

別のキーワード

  1. pathname expand_path
  2. rbconfig expand
  3. file expand_path
  4. text expand_tabs
  5. _builtin expand_path

ライブラリ

検索結果

File.expand_path(path, default_dir = '.') -> String (54415.0)

path を絶対パスに展開した文字列を返します。 path が相対パスであれば default_dir を基準にします。

...> "/home/matz/work/foo"
p ENV["HOME"] #=> "/home/matz"
p File.expand_path("..") #=> "/home/matz/work"
p File.expand_path("..", "/tmp") #=> "/"
p File.expand_path("~") #=> "/home/matz"
p File.expand_path("~foo") #=> "/home/foo"
//}

@param path パスを表...