クラス
- Pathname (69)
キーワード
- atime (1)
- basename (1)
- binread (1)
- binwrite (1)
- birthtime (1)
- blockdev? (1)
- chardev? (1)
- chmod (1)
- chown (1)
- ctime (1)
- directory? (1)
- dirname (1)
-
each
_ entry (1) -
each
_ line (2) - executable? (1)
-
executable
_ real? (1) - exist? (1)
- extname (1)
- file? (1)
- find (2)
- fnmatch (1)
- fnmatch? (1)
- ftype (1)
- grpowned? (1)
- lchmod (1)
- lchown (1)
- lstat (1)
-
make
_ link (1) -
make
_ symlink (1) - mkdir (1)
- mkpath (1)
- mtime (1)
- open (2)
- opendir (2)
- owned? (1)
- pipe? (1)
- read (1)
- readable? (1)
-
readable
_ real? (1) - readlines (1)
- readlink (1)
- rename (1)
- rmdir (1)
- rmtree (1)
- setgid? (1)
- setuid? (1)
- size (1)
- size? (1)
- socket? (1)
- split (1)
- stat (1)
- sticky? (1)
- symlink? (1)
- sysopen (1)
-
to
_ path (1) - truncate (1)
- utime (1)
-
world
_ readable? (1) -
world
_ writable? (1) - writable? (1)
-
writable
_ real? (1) - write (1)
- zero? (1)
検索結果
先頭5件
-
Pathname
# to _ s -> String (63313.0) -
パス名を文字列で返します。
...パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//}... -
Pathname
# fnmatch(pattern , *args) -> bool (27658.0) -
File.fnmatch(pattern, self.to_s, *args) と同じです。
...て `{}' や `**/' は使用できません。
@param args File.fnmatch を参照してください。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
path.fnmatch("test*") # => true
path.fnmatch("TEST*") # => false
path.fnmatch("TES... -
Pathname
# fnmatch?(pattern , *args) -> bool (27658.0) -
File.fnmatch?(pattern, self.to_s, *args) と同じです。
File.fnmatch?(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch を参照してください。
@see File.fnmatch? -
Pathname
# lstat -> File :: Stat (27658.0) -
File.lstat(self.to_s) と同じです。
File.lstat(self.to_s) と同じです。
@see File.lstat -
Pathname
# stat -> File :: Stat (27658.0) -
File.stat(self.to_s) と同じです。
File.stat(self.to_s) と同じです。
@see File.stat -
Pathname
# to _ path -> String (27376.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s... -
Pathname
# atime -> Time (27358.0) -
File.atime(self.to_s) を渡したものと同じです。
...File.atime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("testfile")
pathname.atime # => 2018-12-18 20:58:13 +0900
//}
@see File.atime... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (27358.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
# mkpath -> nil (27358.0) -
FileUtils.mkpath(self.to_s) と同じです。
FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath -
Pathname
# truncate(length) -> 0 (27358.0) -
File.truncate(self.to_s, length) と同じです。
File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Pathname
# dirname -> Pathname (18658.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
# basename(suffix = "") -> Pathname (18358.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
# binread(*args) -> String | nil (18358.0) -
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(20, 10) # => "ne one\nThis is lin... -
Pathname
# chardev? -> bool (18358.0) -
FileTest.chardev?(self.to_s) と同じです。
FileTest.chardev?(self.to_s) と同じです。
@see FileTest.#chardev? -
Pathname
# each _ entry {|pathname| . . . } -> nil (18358.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...to_s) {|f| yield Pathname.new(f) } と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}
@see... -
Pathname
# each _ line(*args) -> Enumerator (18358.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
...t[例][ruby]{
require "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......uire "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("tes... -
Pathname
# each _ line(*args) {|line| . . . } -> nil (18358.0) -
IO.foreach(self.to_s, *args, &block) と同じです。
...t[例][ruby]{
require "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......uire "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("tes... -
Pathname
# executable? -> bool (18358.0) -
FileTest.executable?(self.to_s) と同じです。
FileTest.executable?(self.to_s) と同じです。
@see FileTest.#executable? -
Pathname
# executable _ real? -> bool (18358.0) -
FileTest.executable_real?(self.to_s) と同じです。
FileTest.executable_real?(self.to_s) と同じです。
@see FileTest.#executable_real? -
Pathname
# extname -> String (18358.0) -
File.extname(self.to_s) と同じです。
File.extname(self.to_s) と同じです。
@see File.extname -
Pathname
# make _ link(old) -> 0 (18358.0) -
File.link(old, self.to_s) と同じです。
File.link(old, self.to_s) と同じです。
@see File.link -
Pathname
# make _ symlink(old) -> 0 (18358.0) -
File.symlink(old, self.to_s) と同じです。
File.symlink(old, self.to_s) と同じです。
@see File.symlink -
Pathname
# read(*args) -> String | nil (18358.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# readable? -> bool (18358.0) -
FileTest.readable?(self.to_s) と同じです。
FileTest.readable?(self.to_s) と同じです。
@see FileTest.#readable? -
Pathname
# readable _ real? -> bool (18358.0) -
FileTest.readable_real?(self.to_s) と同じです。
FileTest.readable_real?(self.to_s) と同じです。
@see FileTest.#readable_real? -
Pathname
# readlines(*args) -> [String] (18358.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# readlink -> Pathname (18358.0) -
Pathname.new(File.readlink(self.to_s)) と同じです。
...Pathname.new(File.readlink(self.to_s)) と同じです。
@see File.readlink... -
Pathname
# rename(to) -> 0 (18358.0) -
File.rename(self.to_s, to) と同じです。
File.rename(self.to_s, to) と同じです。
@param to ファイル名を表す文字列を指定します。
@see File.rename -
Pathname
# world _ readable? -> bool (18358.0) -
FileTest.world_readable?(self.to_s) と同じです。
FileTest.world_readable?(self.to_s) と同じです。
@see FileTest.#world_readable? -
Pathname
# world _ writable? -> bool (18358.0) -
FileTest.world_writable?(self.to_s) と同じです。
FileTest.world_writable?(self.to_s) と同じです。
@see FileTest.#world_writable? -
Pathname
# writable? -> bool (18358.0) -
FileTest.writable?(self.to_s) と同じです。
FileTest.writable?(self.to_s) と同じです。
@see FileTest.#writable? -
Pathname
# writable _ real? -> bool (18358.0) -
FileTest.writable_real?(self.to_s) と同じです。
FileTest.writable_real?(self.to_s) と同じです。
@see FileTest.#writable_real? -
Pathname
# mkdir(*args) -> 0 (9358.0) -
Dir.mkdir(self.to_s, *args) と同じです。
Dir.mkdir(self.to_s, *args) と同じです。
@see Dir.mkdir -
Pathname
# split -> Array (9358.0) -
File.split(self.to_s) と同じです。
...File.split(self.to_s) と同じです。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/sample")
pathname.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}
@see File.split... -
Pathname
# sysopen(*args) -> Integer (9358.0) -
IO.sysopen(self.to_s, *args)と同じです。
IO.sysopen(self.to_s, *args)と同じです。
@see IO.sysopen -
Pathname
# utime(atime , mtime) -> Integer (9358.0) -
File.utime(atime, mtime, self.to_s) と同じです。
File.utime(atime, mtime, self.to_s) と同じです。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@see File.utime -
Pathname
# find(ignore _ error: true) -> Enumerator (9328.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
...self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@para... -
Pathname
# find(ignore _ error: true) {|pathname| . . . } -> nil (9328.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
...self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@para... -
Pathname
# binwrite(string , offset=nil) -> Integer (9058.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# birthtime -> Time (9058.0) -
File.birthtime(self.to_s) を渡したものと同じです。
File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime -
Pathname
# blockdev? -> bool (9058.0) -
FileTest.blockdev?(self.to_s) と同じです。
FileTest.blockdev?(self.to_s) と同じです。
@see FileTest.#blockdev? -
Pathname
# chmod(mode) -> Integer (9058.0) -
File.chmod(mode, self.to_s) と同じです。
File.chmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.chmod -
Pathname
# chown(owner , group) -> Integer (9058.0) -
File.chown(owner, group, self.to_s) と同じです。
...。
@param owner オーナーを指定します。
@param group グループを指定します。
//emlist[例][ruby]{
require 'pathname'
Pathname('testfile').stat.uid # => 501
Pathname('testfile').chown(502, 12)
Pathname('testfile').stat.uid # => 502
//}
@see File.chown, File#chown... -
Pathname
# ctime -> Time (9058.0) -
File.ctime(self.to_s) を渡したものと同じです。
....ctime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require 'pathname'
IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}
@see File.ctime... -
Pathname
# directory? -> bool (9058.0) -
FileTest.directory?(self.to_s) と同じです。
FileTest.directory?(self.to_s) と同じです。
@see FileTest.#directory? -
Pathname
# exist? -> bool (9058.0) -
FileTest.exist?(self.to_s) と同じです。
FileTest.exist?(self.to_s) と同じです。
@see FileTest.#exist? -
Pathname
# file? -> bool (9058.0) -
FileTest.file?(self.to_s) と同じです。
FileTest.file?(self.to_s) と同じです。
@see FileTest.#file? -
Pathname
# ftype -> String (9058.0) -
File.ftype(self.to_s) と同じです。
File.ftype(self.to_s) と同じです。
@see File.ftype -
Pathname
# grpowned? -> bool (9058.0) -
FileTest.grpowned?(self.to_s) と同じです。
FileTest.grpowned?(self.to_s) と同じです。
@see FileTest.#grpowned? -
Pathname
# lchmod(mode) -> Integer (9058.0) -
File.lchmod(mode, self.to_s) と同じです。
File.lchmod(mode, self.to_s) と同じです。
@param mode ファイルのアクセス権限を整数で指定します。
@see File.lchmod -
Pathname
# lchown(owner , group) -> Integer (9058.0) -
File.lchown(owner, group, self.to_s) と同じです。
File.lchown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
@see File.lchown -
Pathname
# mtime -> Time (9058.0) -
File.mtime(self.to_s) を渡したものと同じです。
File.mtime(self.to_s) を渡したものと同じです。
@see File.mtime -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) -> File (9058.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# open(mode = & # 39;r& # 39; , perm = 0666) {|file| . . . } -> object (9058.0) -
File.open(self.to_s, *args, &block) と同じです。
File.open(self.to_s, *args, &block) と同じです。
@see File.open -
Pathname
# opendir -> Dir (9058.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# opendir {|dir| . . . } -> nil (9058.0) -
Dir.open(self.to_s, &block) と同じです。
Dir.open(self.to_s, &block) と同じです。
@see Dir.open -
Pathname
# owned? -> bool (9058.0) -
FileTest.owned?(self.to_s) と同じです。
FileTest.owned?(self.to_s) と同じです。
@see FileTest.#owned? -
Pathname
# pipe? -> bool (9058.0) -
FileTest.pipe?(self.to_s) と同じです。
FileTest.pipe?(self.to_s) と同じです。
@see FileTest.#pipe? -
Pathname
# rmdir -> 0 (9058.0) -
Dir.rmdir(self.to_s) と同じです。
Dir.rmdir(self.to_s) と同じです。
@see Dir.rmdir -
Pathname
# rmtree -> nil (9058.0) -
FileUtils.rm_r(self.to_s) と同じです。
FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r -
Pathname
# setgid? -> bool (9058.0) -
FileTest.setgid?(self.to_s) と同じです。
FileTest.setgid?(self.to_s) と同じです。
@see FileTest.#setgid? -
Pathname
# setuid? -> bool (9058.0) -
FileTest.setuid?(self.to_s) と同じです。
FileTest.setuid?(self.to_s) と同じです。
@see FileTest.#setuid? -
Pathname
# size -> Integer (9058.0) -
FileTest.size(self.to_s) と同じです。
FileTest.size(self.to_s) と同じです。
@see FileTest.#size -
Pathname
# size? -> bool (9058.0) -
FileTest.size?(self.to_s) と同じです。
FileTest.size?(self.to_s) と同じです。
@see FileTest.#size? -
Pathname
# socket? -> bool (9058.0) -
FileTest.socket?(self.to_s) と同じです。
FileTest.socket?(self.to_s) と同じです。
@see FileTest.#socket? -
Pathname
# sticky? -> bool (9058.0) -
FileTest.sticky?(self.to_s) と同じです。
FileTest.sticky?(self.to_s) と同じです。
@see FileTest.#sticky? -
Pathname
# symlink? -> bool (9058.0) -
FileTest.symlink?(self.to_s) と同じです。
FileTest.symlink?(self.to_s) と同じです。
@see FileTest.#symlink? -
Pathname
# zero? -> bool (9058.0) -
FileTest.zero?(self.to_s) と同じです。
FileTest.zero?(self.to_s) と同じです。
@see FileTest.#zero? -
Pathname
# write(string , offset=nil , **opts) -> Integer (9028.0) -
IO.write(self.to_s, string, offset, **opts)と同じです。
@see IO.write