るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.032秒)
トップページ > クエリ:File[x] > クエリ:*[x] > バージョン:3.3[x] > クラス:Pathname[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file size
  4. file path
  5. file open

ライブラリ

キーワード

検索結果

Pathname#fnmatch(pattern, *args) -> bool (457.0)

File.fnmatch(pattern, self.to_s, *args) と同じです。

...て `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

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

path = Pathname("testfile")
path.fnmatch("test*") # => true
path.fnmatch("TEST*") # => false
path.fnmatch("TES...

Pathname#fnmatch?(pattern, *args) -> bool (439.0)

File.fnmatch?(pattern, self.to_s, *args) と同じです。

File.fnmatch?(pattern, self.to_s, *args) と同じです。

@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

@see File.fnmatch?

Pathname#open(mode = 'r', perm = 0666) -> File (424.0)

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

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


@see File.open

Pathname#open(mode = 'r', perm = 0666) {|file| ... } -> object (424.0)

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

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


@see File.open

Pathname#expand_path(default_dir = '.') -> Pathname (118.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")
Pathname
.pwd # => #<Pathname:/path/to>
path.expand_...
...path # => #<Pathname:/path/to/testfile>
path.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...

絞り込み条件を変える