るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.038秒)
トップページ > ライブラリ:ビルトイン[x] > バージョン:2.5.0[x] > クエリ:Class[x] > クエリ:filename[x] > 種類:特異メソッド[x]

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. class new
  5. argf.class gets

クラス

キーワード

検索結果

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

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

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

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

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

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

File.path("/dev/null") ...

File.stat(filename) -> File::Stat (397.0)

filename の情報を含む File::Stat オブジェクトを生成し て返します。

filename の情報を含む File::Stat オブジェクトを生成し
て返します。

@param filename ファイル名を表す文字列を指定します。

@raise Errno::EXXX 情報の取得に失敗した場合に発生します。

//emlist[例][ruby]{
File.stat("testfile").class # => File::Stat
File.stat("testfile").mtime # => 2017-12-10 01:13:56 +0900
//}

@see IO#stat, File#lstat