るりまサーチ

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

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. csv path

キーワード

検索結果

<< 1 2 3 > >>

File#path -> String (18129.0)

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

...る場合です。

@
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/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

RubyVM::InstructionSequence#path -> String (18128.0)

self が表す命令シーケンスの相対パスを返します。

...ompiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@
see Ruby...
...VM::InstructionSequence#absolute_path...

Thread::Backtrace::Location#path -> String (18122.0)

self が表すフレームのファイル名を返します。

...self が表すフレームのファイル名を返します。

例: Thread::Backtrace::Location の例1を用いた例

//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}

@
see Thread::Backtrace::Location#absolute_path...

TracePoint#path -> String (18122.0)

イベントが発生したファイルのパスを返します。

...トが発生したファイルのパスを返します。

@
raise RuntimeError イベントフックの外側で実行した場合に発生します。

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
foo 1
//}...

Thread::Backtrace::Location#absolute_path -> String (6146.0)

self が表すフレームの絶対パスを返します。

...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@
locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@
see Thread::Backtrace::Location#path...

絞り込み条件を変える

File#to_path -> String (6129.0)

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

...る場合です。

@
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/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

RubyVM::InstructionSequence#absolute_path -> String | nil (6128.0)

self が表す命令シーケンスの絶対パスを返します。

...:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp...
.../method.rb"

@
see RubyVM::InstructionSequence#path...

Encoding::Converter#convpath -> Array (6115.0)

変換器が行う変換の経路を配列にして返します。

...ます。

@
return 変換器が行う変換の経路の配列

//emlist[][ruby]{
ec = Encoding::Converter.new("ISo-8859-1", "EUC-JP", crlf_newline: true)
p ec.convpath
#=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
# "crlf_newline"]
//}

@
see Encod...
...ing::Converter.search_convpath...

IO#reopen(path) -> self (153.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...
path
で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

@
param path パスを表す文字列を指定します。

@
param mode パ...
...スを開く際のモードを文字列で指定します。

@
raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.re...
...adlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@
see Kernel.#open...

IO#reopen(path, mode) -> self (153.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...
path
で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

@
param path パスを表す文字列を指定します。

@
param mode パ...
...スを開く際のモードを文字列で指定します。

@
raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.re...
...adlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}

@
see Kernel.#open...

絞り込み条件を変える

<< 1 2 3 > >>