1238件ヒット
[1-100件を表示]
(0.105秒)
別のキーワード
ライブラリ
- pathname (1238)
キーワード
- + (12)
-
/ (11) - <=> (12)
- == (12)
- === (12)
- absolute? (12)
- ascend (24)
- atime (12)
- basename (12)
- binread (12)
- binwrite (12)
- birthtime (11)
- blockdev? (12)
- chardev? (12)
- children (12)
- chmod (12)
- chown (12)
- cleanpath (12)
- ctime (12)
- delete (12)
- descend (24)
- directory? (12)
- dirname (12)
-
each
_ child (24) -
each
_ entry (15) -
each
_ filename (12) -
each
_ line (24) - empty? (9)
- entries (12)
- eql? (12)
- executable? (12)
-
executable
_ real? (12) - exist? (12)
- extname (12)
- file? (12)
- find (24)
- fnmatch (12)
- fnmatch? (12)
- ftype (12)
- glob (16)
- grpowned? (12)
- hash (12)
- join (12)
- lchmod (12)
- lchown (12)
- lstat (12)
-
make
_ link (12) -
make
_ symlink (12) - mkdir (12)
- mkpath (12)
- mountpoint? (12)
- mtime (12)
- open (24)
- opendir (24)
- owned? (12)
- parent (12)
- pipe? (12)
- read (12)
- readable? (12)
-
readable
_ real? (12) - readlines (12)
- readlink (12)
- realdirpath (12)
- realpath (24)
- relative? (12)
-
relative
_ path _ from (12) - rename (12)
- rmdir (12)
- rmtree (12)
- root? (12)
- setgid? (12)
- setuid? (12)
- size (12)
- size? (12)
- socket? (12)
- split (12)
- stat (12)
- sticky? (12)
- sub (24)
-
sub
_ ext (12) - symlink? (12)
- sysopen (12)
-
to
_ path (12) -
to
_ s (12) - truncate (12)
- unlink (12)
- utime (12)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (12)
- zero? (12)
検索結果
先頭5件
-
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (15302.0) -
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
...Pathname.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... -
Pathname
# realpath -> Pathname (9208.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...い Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。
@para......quire '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 (9208.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...い Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。
@para......quire '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 (9202.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。
@param consider_symlink 真ならパス要素にシンボリック......quire "pathname"
path = Pathname.new("//.././../")
path # => #<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/../bar")
Dir.chdir("/tmp")
path.cleanpath # => #<Pathname:bar/bar>
path.cleanpath(true) # => #<Pathname:bar/foo/../bar>
//}... -
Pathname
# parent -> Pathname (9202.0) -
self の親ディレクトリを指す新しい Pathname オブジェクトを返します。
...新しい Pathname オブジェクトを返します。
//emlist[例 絶対パス][ruby]{
require "pathname"
path = Pathname("/usr")
path # => #<Pathname:/usr>
path.parent # => #<Pathname:/>
//}
//emlist[例 相対パス][ruby]{
require "pathname"
path = Pathname("foo/bar")
path.parent......# => #<Pathname:foo>
path.parent.parent # => #<Pathname:.>
path.parent.parent.parent # => #<Pathname:..>
//}... -
Pathname
# realdirpath(basedir = nil) -> Pathname (9202.0) -
Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に 存在しなくてもエラーになりません。
...
Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に
存在しなくてもエラーになりません。
@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//emlist[例][ruby]{
require "pathna......me"
path = Pathname("/not_exist")
path.realdirpath # => #<Pathname:/not_exist>
path.realpath # => Errno::ENOENT
# 最後ではないコンポーネント(/not_exist_1)も存在しないのでエラーになる。
path = Pathname("/not_exist_1/not_exist_2")
path.realdirpath # => Errno::ENOENT......//}
@see Pathname#realpath... -
Pathname
# relative _ path _ from(base _ directory) -> Pathname (9202.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
...base_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。
パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。
self が相対パスなら base_directory......も相対パス、self が絶対パスなら
base_directory も絶対パスでなければなりません。
@param base_directory ベースディレクトリを表す Pathname オブジェクトを指定します。
@raise ArgumentError Windows上でドライブが違うなど、base_directory......から self への相対パスが求められないときに例外が発生します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/foo")
base = Pathname.new("/tmp")
path.relative_path_from(base) # => #<Pathname:foo>
//}... -
Pathname
# mkpath -> nil (9102.0) -
FileUtils.mkpath(self.to_s) と同じです。
...FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath... -
Pathname
# to _ path -> String (9102.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s...