るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. psych root
  2. pstore root?
  3. document root
  4. pathname root?
  5. rexml/document root

ライブラリ

キーワード

検索結果

Dir.chroot(path) -> 0 (18304.0)

ルートディレクトリを path に変更します。

...トリのパスを文字列で指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
p Dir.glob("*") #=> ["file1", "file2]
Dir
.chroot("./")
p Dir.glob("/*") #=> ["/file1", "/file2]
//}

@see http://opengroup.org/onlinepubs/007908799/xsh/chroot.html...

Dir.home -> String | nil (76.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 (76.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...