るりまサーチ

最速Rubyリファレンスマニュアル検索!
78件ヒット [1-78件を表示] (0.051秒)
トップページ > クエリ:string[x] > クエリ:Ruby[x] > クエリ:to_path[x]

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

Dir#to_path -> String (15215.0)

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

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

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

File#to_path -> String (15209.0)

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

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

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../t...
...です。

@raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../t...

IO#to_path -> String | nil (15209.0)

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

...します。

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

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

File.path(filename) -> String (135.0)

指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。

...は、to_path メソッドを呼びます。

@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。

//emlist[例][ruby]{
require 'pathname'

class MyPath
def initialize(path)
@path = path
end
def to_path
File...

Dir#path -> String (115.0)

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

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

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

絞り込み条件を変える

File.join(*item) -> String (113.0)

File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。

...に変換されます。
配列・文字列以外のオブジェクトを指定した場合は、まず to_str メソッド、次に to_path メソッドにより暗黙の型変換を試みます。
引数がない場合には空文字列を生成して返します。

@raise...
...限にネストした配列や、
ヌル文字を含む文字列が存在した場合に発生します。

//emlist[例][ruby]{
File.join("a","b") # => "a/b"
File.join("a/","b") # => "a/b"
File.join("a/","/b")...

File#path -> String (109.0)

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

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

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../t...
...です。

@raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../t...

IO#path -> String | nil (109.0)

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

...します。

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

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