871件ヒット
[1-100件を表示]
(0.142秒)
種類
- インスタンスメソッド (838)
- 特異メソッド (22)
- 定数 (11)
ライブラリ
- pathname (871)
キーワード
- + (11)
-
/ (10) - <=> (11)
- == (11)
- === (11)
-
SEPARATOR
_ PAT (11) - ascend (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- chardev? (11)
- children (11)
- chmod (11)
- chown (11)
- cleanpath (11)
- delete (11)
- descend (11)
- directory? (11)
- dirname (11)
-
each
_ child (22) -
each
_ entry (13) -
each
_ line (22) - entries (11)
- eql? (11)
-
executable
_ real? (11) - extname (11)
- find (21)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- glob (36)
- grpowned? (11)
- hash (11)
- join (11)
- lchmod (11)
- lchown (11)
- mkdir (11)
- open (22)
- opendir (22)
- parent (11)
- read (11)
- readable? (11)
-
readable
_ real? (11) - readlines (11)
- readlink (11)
- realdirpath (11)
- realpath (22)
- relative? (11)
-
relative
_ path _ from (11) - rename (11)
- rmdir (11)
- rmtree (11)
- root? (11)
- size (11)
- split (11)
- sub (22)
-
sub
_ ext (11) - sysopen (11)
-
to
_ path (11) -
to
_ s (11) - truncate (11)
- unlink (11)
- utime (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (11)
- zero? (11)
検索結果
先頭5件
-
Pathname
# readable _ real? -> bool (12301.0) -
FileTest.readable_real?(self.to_s) と同じです。
...FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real?... -
Pathname
# children(with _ directory = true) -> [Pathname] (6307.0) -
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
...self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
ただし、 ".", ".." は要素に含まれません。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
@raise Errno::EXXX self が存在しないパ......スであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/tmp").children # => [#<Pathname:.X11-unix>, #<Pathname:.iroha_unix>, ... ]
//}... -
Pathname
# binwrite(string , offset=nil) -> Integer (6301.0) -
IO.binwrite(self.to_s, *args)と同じです。
...IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite... -
Pathname
# opendir -> Dir (6301.0) -
Dir.open(self.to_s, &block) と同じです。
...Dir.open(self.to_s, &block) と同じです。
@see Dir.open... -
Pathname
# relative _ path _ from(base _ directory) -> Pathname (6301.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
...se_directory から self への相対パスを求め、その内容の新しい Pathname
オブジェクトを生成して返します。
パス名の解決は文字列操作によって行われ、ファイルシステムをアクセス
しません。
self が相対パスなら base_directory......絶対パスなら
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
# write(string , offset=nil , **opts) -> Integer (6301.0) -
...IO.write(self.to_s, string, offset, **opts)と同じです。
@see IO.write... -
Pathname
# rmtree -> nil (6223.0) -
FileUtils.rm_r(self.to_s) と同じです。
...FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r... -
Pathname
# realpath -> Pathname (6219.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
... Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。
@param b......dir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//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 (6219.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
... Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。
@param b......dir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//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
# binread(*args) -> String | nil (6201.0) -
IO.binread(self.to_s, *args)と同じです。
...IO.binread(self.to_s, *args)と同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(2......0, 10) # => "ne one\nThis is line "
//}
@see IO.binread...