るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. _builtin to_h
  2. struct to_h
  3. array to_h
  4. hash to_h
  5. ostruct to_h

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/foo"
p ENV["HOME"] #=> "/home/matz"
p File.expand_path("..") #=> "/h...

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

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

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

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

@see File.expand_path

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

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

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

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

@see File.expand_path

File.absolute_path(file_name, dir_string=nil) -> String (18961.0)

file_name を絶対パスに変換した文字列を返します。

file_name を絶対パスに変換した文字列を返します。

相対パスの場合はカレントディレクトリを基準とします。
dir_string を渡した場合はそのディレクトリを基準とします。

File.expand_path と異なり、 file_name 先頭が "~" である場合
それは展開されません。普通のディレクトリ名として処理されます。

//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/bar"
p ENV["HOME"] #=> "/home/mat...

Dir.home -> String | nil (18661.0)

現在のユーザまたは指定されたユーザのホームディレクトリを返します。

現在のユーザまたは指定されたユーザのホームディレクトリを返します。

Dir.home や Dir.home("root") は
File.expand_path("~") や File.expand_path("~root") と
ほぼ同じです。

//emlist[例][ruby]{
Dir.home # => "/home/vagrant"
Dir.home("root") # => "/root"
//}

@see File.expand_path

絞り込み条件を変える

Dir.home(user) -> String | nil (18661.0)

現在のユーザまたは指定されたユーザのホームディレクトリを返します。

現在のユーザまたは指定されたユーザのホームディレクトリを返します。

Dir.home や Dir.home("root") は
File.expand_path("~") や File.expand_path("~root") と
ほぼ同じです。

//emlist[例][ruby]{
Dir.home # => "/home/vagrant"
Dir.home("root") # => "/root"
//}

@see File.expand_path

ruby 1.6 feature (1135.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) -> stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていま...