4件ヒット
[1-4件を表示]
(0.035秒)
検索結果
-
File
# to _ path -> String (45382.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
# to _ path -> String (45364.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//} -
File
# path -> String (82.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 (64.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}