ライブラリ
-
net
/ ftp (36) - pathname (1144)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
-
Net
:: FTP (27) -
Net
:: FTP :: MLSxEntry (9) - Pathname (1133)
-
RDoc
:: Options (22) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
モジュール
- Kernel (11)
キーワード
- + (11)
-
/ (10) - <=> (11)
- == (11)
- === (11)
- absolute? (11)
- ascend (22)
- atime (11)
- basename (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- blockdev? (11)
- chardev? (11)
- children (11)
- chmod (11)
- chown (11)
- cleanpath (11)
- ctime (11)
- delete (11)
- descend (22)
- directory? (11)
- dirname (11)
-
each
_ child (22) -
each
_ entry (13) -
each
_ filename (11) -
each
_ line (22) - empty? (8)
- entries (11)
- eql? (11)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- extname (11)
- file? (11)
- find (22)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- glob (14)
- grpowned? (11)
- hash (11)
- join (11)
- lchmod (11)
- lchown (11)
- lstat (11)
-
make
_ link (11) -
make
_ symlink (11) - mkdir (11)
- mkpath (11)
- mlsd (18)
- mlst (9)
- mountpoint? (11)
- mtime (11)
- open (22)
- opendir (22)
- owned? (11)
-
page
_ dir (11) - parent (11)
- pathname (9)
- pipe? (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)
- root? (11)
- setgid? (11)
- setuid? (11)
- size (11)
- size? (11)
- socket? (11)
- split (29)
- stat (11)
- sticky? (11)
- sub (22)
-
sub
_ ext (11) - symlink? (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
# basename(suffix = "") -> Pathname (30384.0) -
Pathname.new(File.basename(self.to_s, suffix)) と同じです。
...Pathname.new(File.basename(self.to_s, suffix)) と同じです。
@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。
//emli......require "pathname"
Pathname("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Pathname("ruby/ruby.c").basename(".c") #=> #<Pathname:"ruby">
Pathname("ruby/ruby.c").basename(".*") #=> #<Pathname:"ruby">
Pathname("ruby/ruby.exe").basename(".*") #=> #<Pathname:"ruby">
Pathname("ruby/y.......tab.c").basename(".*") #=> #<Pathname:"y.tab">
//}
@see File.basename... -
Pathname
# dirname -> Pathname (30336.0) -
Pathname.new(File.dirname(self.to_s)) と同じです。
...Pathname.new(File.dirname(self.to_s)) と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname('/usr/bin/shutdown').dirname # => #<Pathname:/usr/bin>
//}
@see File.dirname... -
Pathname
# mountpoint? -> bool (30219.0) -
self がマウントポイントであれば真を返します。
...self がマウントポイントであれば真を返します。
//emlist[例][ruby]{
require "pathname"
path = Pathname("/")
path.mountpoint? # => true
path = Pathname("/usr")
path.mountpoint? # => false
//}... -
Pathname
# each _ filename {|v| . . . } -> nil (30113.0) -
self のパス名要素毎にブロックを実行します。
...self のパス名要素毎にブロックを実行します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/foo/../bar").each_filename {|v| p v}
# => "foo"
# ".."
# "bar"
//}... -
Pathname
# extname -> String (30101.0) -
File.extname(self.to_s) と同じです。
...File.extname(self.to_s) と同じです。
@see File.extname... -
Pathname
# rename(to) -> 0 (30101.0) -
File.rename(self.to_s, to) と同じです。
...File.rename(self.to_s, to) と同じです。
@param to ファイル名を表す文字列を指定します。
@see File.rename... -
Pathname
# each _ line(*args) {|line| . . . } -> nil (27315.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
..."pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}
//emlist[例 ブロックを指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line {|f| p f }
# => "lin......e1\n"
# => "line2,\n"
# => "line3\n"
//}
//emlist[例 limit を指定][ruby]{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }
# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}
//emlist[例 sep を指定][ruby]......{
require "pathname"
IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(",") {|f| p f }
# => "line1\nline2,"
# => "\nline3\n"
//}
@see IO.foreach... -
Pathname
# ascend {|pathname| . . . } -> nil (27290.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
...い Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/......o/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>
Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
# #<Pathname:path/to/some>
# #<Pathname:path/to>
# #<Pathname:path>
//}
ファイ... -
Pathname
# descend {|pathname| . . . } -> nil (27290.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
...い
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>
#......#<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to/some/file.rb>
Pathname.new('path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:path>
# #<Pathname:path/to>
# #<Pathname:path/to/some>
# #<Pathname:path/to/some/file.rb>
//}
ファ... -
Pathname
# entries -> [Pathname] (27290.0) -
self に含まれるファイルエントリ名を元にした Pathname オブジェクトの配列を返します。
...した Pathname オブジェクトの配列を返します。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
require 'pp'
pp Pathname('/usr/local').entries
# => [#<Pathname:.>,
#......#<Pathname:..>,
# #<Pathname:bin>,
# #<Pathname:etc>,
# #<Pathname:include>,
# #<Pathname:lib>,
# #<Pathname:opt>,
# #<Pathname:sbin>,
# #<Pathname:share>,
# #<Pathname:var>]
//}
@see Dir.entries...