るりまサーチ

最速Rubyリファレンスマニュアル検索!
7028件ヒット [101-200件を表示] (0.062秒)
トップページ > クエリ:file[x] > 種類:インスタンスメソッド[x]

別のキーワード

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

クラス

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Gem::ConfigFile#config_file_name -> String (9102.0)

設定ファイルの名前を返します。

設定ファイルの名前を返します。

File#path -> String (9043.0)

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

...Error 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?)
//}...

File#to_path -> String (9043.0)

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

...Error 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?)
//}...

File#path -> String (9037.0)

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

...
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::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...

File#to_path -> String (9037.0)

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

...
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::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...

絞り込み条件を変える

File#atime -> Time (9031.0)

最終アクセス時刻を Time オブジェクトとして返します。

...に発生します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#ctime, File#mtime, File#birthtime...

File#birthtime -> Time (9031.0)

作成された時刻を Time オブジェクトとして返します。

...::EXXX ファイルの時刻の取得に失敗した場合に発生します。

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

File
.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003

@see File#lstat, File#atime, File#ctime, File#mtime...

File#ctime -> Time (9031.0)

状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。

...に発生します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#atime, File#mtime, File#birthtime...

File#mtime -> Time (9031.0)

最終更新時刻を Time オブジェクトとして返します。

...に発生します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.open("testfile") { |f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#atime, File#ctime, File#birthtime...

File#atime -> Time (9025.0)

最終アクセス時刻を Time オブジェクトとして返します。

...れている場合に発生します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#ctime, File#mtime...

絞り込み条件を変える

File#chown(owner, group) -> 0 (9025.0)

ファイルのオーナーとグループを変更します。

...ます。

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

//emlist[例][ruby]{
File
.open("testfile") { |f| f.chown(502, 1000) } # => 0
File
.stat("testfile").uid # => 502
File
.stat("testfile").gid # => 1000
//}

@see File.chown...

File#ctime -> Time (9025.0)

状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。

...れている場合に発生します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#atime, File#mtime...

File#mtime -> Time (9025.0)

最終更新時刻を Time オブジェクトとして返します。

...ている場合に発生します。

@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File
.open("testfile") { |f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}

@see File#lstat, File#atime, File#ctime...

File#size -> Integer (9013.0)

ファイルのサイズを返します。

...ファイルのサイズを返します。

//emlist[例][ruby]{
File
.open("/dev/null") do |f|
f.size #=> 0
end
//}

@raise IOError 自身が close されている場合に発生します。

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

@see File#lstat...
<< < 1 2 3 4 ... > >>