5件ヒット
[1-5件を表示]
(0.151秒)
検索結果
先頭5件
-
Pathname
# to _ path -> String (81607.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s -
Dir
# to _ path -> String (63625.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//} -
File
# to _ path -> String (63607.0) -
オープン時に使用したパスを文字列で返します。
オープン時に使用したパスを文字列で返します。
パスは self に対応するファイルを指しているとは限りません。
たとえば、ファイルが移動されていたり、削除されていたり、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/..... -
Dir
# path -> String (18325.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//} -
File
# path -> String (18307.0) -
オープン時に使用したパスを文字列で返します。
オープン時に使用したパスを文字列で返します。
パスは self に対応するファイルを指しているとは限りません。
たとえば、ファイルが移動されていたり、削除されていたり、
File::Constants::TMPFILEオプション付きで作成されていたりする場合です。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/.....