768件ヒット
[1-100件を表示]
(0.081秒)
ライブラリ
- pathname (768)
キーワード
- atime (11)
- basename (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- blockdev? (11)
- chardev? (11)
- chmod (11)
- chown (11)
- ctime (11)
- directory? (11)
- dirname (11)
-
each
_ entry (13) -
each
_ line (22) - empty? (8)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- extname (11)
- file? (11)
- find (22)
- fnmatch (11)
- fnmatch? (11)
- ftype (11)
- grpowned? (11)
- lchmod (11)
- lchown (11)
- lstat (11)
-
make
_ link (11) -
make
_ symlink (11) - mkdir (11)
- mkpath (11)
- mtime (11)
- open (22)
- opendir (22)
- owned? (11)
- pipe? (11)
- read (11)
- readable? (11)
-
readable
_ real? (11) - readlines (11)
- readlink (11)
- rename (11)
- rmdir (11)
- rmtree (11)
- setgid? (11)
- setuid? (11)
- size (11)
- size? (11)
- socket? (11)
- split (11)
- stat (11)
- sticky? (11)
- symlink? (11)
- sysopen (11)
-
to
_ path (11) - truncate (11)
- utime (11)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (11)
- zero? (11)
検索結果
先頭5件
-
Pathname
# to _ s -> String (18103.0) -
パス名を文字列で返します。
...パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//}... -
Pathname
# empty? -> bool (34.0) -
ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
...ては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'
Pathname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => tru......e
//}
//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'
Pathname("testfile").empty? # => false
Tempfile.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}
@see Dir.empty?, FileTest.#empty?, Pathname#zero?... -
Pathname
# to _ path -> String (24.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s... -
Pathname
# atime -> Time (18.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
# basename(suffix = "") -> Pathname (18.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 (18.0) -
IO.binread(self.to_s, *args)と同じです。
...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,... -
Pathname
# binwrite(string , offset=nil) -> Integer (18.0) -
IO.binwrite(self.to_s, *args)と同じです。
...IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite... -
Pathname
# birthtime -> Time (18.0) -
File.birthtime(self.to_s) を渡したものと同じです。
...File.birthtime(self.to_s) を渡したものと同じです。
@raise NotImplementedError Windows のような birthtime のない環境で発生します。
@see File.birthtime... -
Pathname
# blockdev? -> bool (18.0) -
FileTest.blockdev?(self.to_s) と同じです。
...FileTest.blockdev?(self.to_s) と同じです。
@see FileTest.#blockdev?... -
Pathname
# chardev? -> bool (18.0) -
FileTest.chardev?(self.to_s) と同じです。
...FileTest.chardev?(self.to_s) と同じです。
@see FileTest.#chardev?...