るりまサーチ

最速Rubyリファレンスマニュアル検索!
59件ヒット [1-59件を表示] (0.153秒)

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

クラス

検索結果

Pathname#to_path -> String (27202.0)

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。

...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。


@see Pathname#to_s...

IO#to_path -> String | nil (21220.0)

IO に関連付けられたパスを返します。IO がパスに関連付けられていない場合は nil を返します。

...が返すパスがファイルシステム上に存在することは保証されていません。

//emlist[例][ruby]{
p
STDIN.path # => "<STDIN>"
p
IO.new(IO.sysopen("/")).path # => "/"
p
IO.new(IO.sysopen("/"), path: "foo").path # => "foo"
//}...

Dir#to_path -> String (21208.0)

オープンしているディレクトリのパス名を文字列で返します。

...オープンしているディレクトリのパス名を文字列で返します。

//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}...

File#to_path -> String (21202.0)

オープン時に使用したパスを文字列で返します。

...::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE...
...){|f| f.path } #=> "/tmp"
//}...
...TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp",...
...File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

IO#path -> String | nil (6120.0)

IO に関連付けられたパスを返します。IO がパスに関連付けられていない場合は nil を返します。

...が返すパスがファイルシステム上に存在することは保証されていません。

//emlist[例][ruby]{
p
STDIN.path # => "<STDIN>"
p
IO.new(IO.sysopen("/")).path # => "/"
p
IO.new(IO.sysopen("/"), path: "foo").path # => "foo"
//}...

絞り込み条件を変える

Dir#path -> String (6108.0)

オープンしているディレクトリのパス名を文字列で返します。

...オープンしているディレクトリのパス名を文字列で返します。

//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}...

File#path -> String (6102.0)

オープン時に使用したパスを文字列で返します。

...::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE...
...){|f| f.path } #=> "/tmp"
//}...
...TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp",...
...File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...