るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.021秒)
トップページ > クエリ:File[x] > クエリ:rmdir[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file mtime
  4. file umask
  5. file atime

ライブラリ

クラス

キーワード

検索結果

Pathname#realpath -> Pathname (31.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...リになります。

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

Dir.rmdir("/tmp/foo") rescue nil
File
.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File
.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/.....
.../bar")

Dir.chdir("/tmp")

p path.realpath

# => ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

Pathname#realpath(basedir = nil) -> Pathname (31.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...リになります。

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

Dir.rmdir("/tmp/foo") rescue nil
File
.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File
.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/.....
.../bar")

Dir.chdir("/tmp")

p path.realpath

# => ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

Pathname#cleanpath(consider_symlink = false) -> Pathname (25.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...../>
path.cleanpath # => #<Pathname:/>


require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File
.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File
.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/...