るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#to_s -> String (18103.0)

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

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


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

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

Pathname#empty? -> bool (34.0)

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

...ては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'

Pathname
("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => tru...
...e
//}

//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'

Pathname
("testfile").empty? # => false
Tempfile.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}

@see Dir.empty?, FileTest.#empty?, Pathname#zero?...

Pathname#to_path -> String (24.0)

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

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


@see Pathname#to_s...

Pathname#atime -> Time (18.0)

File.atime(self.to_s) を渡したものと同じです。

...File.atime(self.to_s) を渡したものと同じです。

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

pathname
= Pathname("testfile")
pathname
.atime # => 2018-12-18 20:58:13 +0900
//}

@see File.atime...

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

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

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

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

//emli...
...require "pathname"

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

@see File.basename...

絞り込み条件を変える

Pathname#binread(*args) -> String | nil (18.0)

IO.binread(self.to_s, *args)と同じです。

...binread(self.to_s, *args)と同じです。

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

pathname
= Pathname("testfile")
pathname
.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname
.binread(20) # => "This is line one\nThi"
pathname
.binread(20,...

Pathname#binwrite(string, offset=nil) -> Integer (18.0)

IO.binwrite(self.to_s, *args)と同じです。

...IO.binwrite(self.to_s, *args)と同じです。


@see IO.binwrite...

Pathname#birthtime -> Time (18.0)

File.birthtime(self.to_s) を渡したものと同じです。

...File.birthtime(self.to_s) を渡したものと同じです。

@raise NotImplementedError Windows のような birthtime のない環境で発生します。


@see File.birthtime...

Pathname#blockdev? -> bool (18.0)

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

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


@see FileTest.#blockdev?...

Pathname#chardev? -> bool (18.0)

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

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


@see FileTest.#chardev?...

絞り込み条件を変える

<< 1 2 3 ... > >>