検索結果
先頭5件
-
Pathname
# to _ s -> String (114943.0) -
パス名を文字列で返します。
パス名を文字列で返します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/hogehoge")
File.open(path)
//} -
Pathname
# each _ entry {|pathname| . . . } -> nil (88465.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
Dir.foreach(self.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>
//}
@... -
Pathname
# rmtree -> nil (87952.0) -
FileUtils.rm_r(self.to_s) と同じです。
FileUtils.rm_r(self.to_s) と同じです。
@see FileUtils.#rm_r -
Pathname
# truncate(length) -> 0 (87952.0) -
File.truncate(self.to_s, length) と同じです。
File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Pathname
# binread(*args) -> String | nil (70060.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(20, 10) # => ... -
Pathname
# binwrite(string , offset=nil) -> Integer (69952.0) -
IO.binwrite(self.to_s, *args)と同じです。
IO.binwrite(self.to_s, *args)と同じです。
@see IO.binwrite -
Pathname
# extname -> String (69952.0) -
File.extname(self.to_s) と同じです。
File.extname(self.to_s) と同じです。
@see File.extname -
Pathname
# ftype -> String (69952.0) -
File.ftype(self.to_s) と同じです。
File.ftype(self.to_s) と同じです。
@see File.ftype -
Pathname
# read(*args) -> String | nil (69952.0) -
IO.read(self.to_s, *args)と同じです。
IO.read(self.to_s, *args)と同じです。
@see IO.read -
Pathname
# readlines(*args) -> [String] (69952.0) -
IO.readlines(self.to_s, *args)と同じです。
IO.readlines(self.to_s, *args)と同じです。
@see IO.readlines -
Pathname
# write(string , offset=nil , **opts) -> Integer (69922.0) -
IO.write(self.to_s, string, offset, **opts)と同じです。
@see IO.write -
Pathname
# find(ignore _ error: true) {|pathname| . . . } -> nil (61291.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Pathname
# find(ignore _ error: true) -> Enumerator (60991.0) -
self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。
self 配下のすべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。
require 'find'
Find.find(self.to_s) {|f| yield Pathname.new(f)}
と同じです。
ブロックを省略した場合は Enumerator を返します。
@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。
@see Find.#find -
Pathname
# to _ path -> String (60736.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s