るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#to_s -> String (21120.0)

パス名を文字列で返します。

...パス名を文字列で返します。


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

path
= Pathname.new("/tmp/hogehoge")
File
.open(path)
//}...

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (9310.0)

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

...Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

@param default_dir self が相対パスであれば default_dir を基準に展開されます。

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

path
= Pathname("testfile")
Path
name.pwd # => #<Pathname:/path/to>
path
.expand_...
...path # => #<Pathname:/path/to/testfile>
path
.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...

Pathname#file? -> bool (9140.0)

FileTest.file?(self.to_s) と同じです。

...FileTest.file?(self.to_s) と同じです。


@see FileTest.#file?...

Pathname#to_path -> String (9140.0)

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

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


@see Pathname#to_s...

Pathname#open(mode = &#39;r&#39;, perm = 0666) -> File (3141.0)

File.open(self.to_s, *args, &block) と同じです。

...File.open(self.to_s, *args, &block) と同じです。


@see File.open...

絞り込み条件を変える

Pathname#open(mode = &#39;r&#39;, perm = 0666) {|file| ... } -> object (3141.0)

File.open(self.to_s, *args, &block) と同じです。

...File.open(self.to_s, *args, &block) と同じです。


@see File.open...

Pathname#lstat -> File::Stat (3140.0)

File.lstat(self.to_s) と同じです。

...File.lstat(self.to_s) と同じです。


@see File.lstat...

Pathname#stat -> File::Stat (3140.0)

File.stat(self.to_s) と同じです。

...File.stat(self.to_s) と同じです。


@see File.stat...

Pathname#basename(suffix = "") -> Pathname (3139.0)

Pathname.new(File.basename(self.to_s, suffix)) と同じです。

...Pathname.new(File.basename(self.to_s, suffix)) と同じです。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

//emli...
...]{
require "pathname"

Path
name("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Path
name("ruby/ruby.c").basename(".c") #=> #<Pathname:"ruby">
Path
name("ruby/ruby.c").basename(".*") #=> #<Pathname:"ruby">
Path
name("ruby/ruby.exe").basename(".*") #=> #<Pathname:"ruby">
Path
name("ruby/...
...y.tab.c").basename(".*") #=> #<Pathname:"y.tab">
//}

@see File.basename...
<< 1 2 3 ... > >>