るりまサーチ

最速Rubyリファレンスマニュアル検索!
34件ヒット [1-34件を表示] (0.073秒)
トップページ > クエリ:l[x] > クエリ:exp[x] > クエリ:expand_path[x]

別のキーワード

  1. math exp
  2. float min_exp
  3. bn mod_exp
  4. float max_exp
  5. openssl mod_exp

検索結果

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

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

...ます。
path が相対パスであれば default_dir を基準にします。

先頭の ~ はホームディレクトリ(環境変数 HOME が使われます)に、
~USER はそのユーザのホームディレクトリに展開されます。

//emlist[例][ruby]{
p Dir.getwd...
.../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 パスを表す文字列を指定します。

@param default_dir path が...
...相対パスであれば default_dir を基準に展開されます。...

Shell#expand_path(path) -> String (27207.0)

Fileクラスにある同名のクラスメソッドと同じです.

...Fileクラスにある同名のクラスメソッドと同じです.

@param path ファイル名を表す文字列を指定します。

@see File.expand_path...

Shell::CommandProcessor#expand_path(path) -> String (27207.0)

Fileクラスにある同名のクラスメソッドと同じです.

...Fileクラスにある同名のクラスメソッドと同じです.

@param path ファイル名を表す文字列を指定します。

@see File.expand_path...

Pathname#expand_path(default_dir = '.') -> Pathname (24335.0)

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

...new(File.expand_path(self.to_s, *args)) と同じです。

@param default_dir self が相対パスであれば default_dir を基準に展開されます。

//emlist[例][ruby]{
require "pathname"

path = Pathname("testfile")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_path...
...# => #<Pathname:/path/to/testfile>
path.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...