るりまサーチ

最速Rubyリファレンスマニュアル検索!
12824件ヒット [1-100件を表示] (0.106秒)
トップページ > クエリ:l[x] > クエリ:File[x]

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

クラス

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

File (44024.0)

ファイルアクセスのためのクラスです。

...のためのクラスです。

通常 Kernel.#open または File.open を使って生成します。
IO クラスがインクルードしている File::Constants は File クラスに関係する定数を
格納したモジュールです。
また File::Stat は stat 構造体( stat(2) 参照)...

File.file?(path) -> bool (36217.0)

FileTest.#file? と同じです。

...
File
Test.#file? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...

File.delete(*filename) -> Integer (30330.0)

ファイルを削除します。削除したファイルの数を返します。 削除に失敗した場合は例外 Errno::EXXX が発生します。

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

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

//emlist[例][ruby]{
IO.write("test.txt", "test")
p File.exist?("test.txt") # => true
p File.delete("test.txt") # => 1
p File.exist?("test.txt") # => false
begin
File
....
...delete("test.txt")
rescue
p $! # => #<Errno::ENOENT: No such file or directory @ unlink_internal - test.txt>
end
//}...

File.unlink(*filename) -> Integer (30230.0)

ファイルを削除します。削除したファイルの数を返します。 削除に失敗した場合は例外 Errno::EXXX が発生します。

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

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

//emlist[例][ruby]{
IO.write("test.txt", "test")
p File.exist?("test.txt") # => true
p File.delete("test.txt") # => 1
p File.exist?("test.txt") # => false
begin
File
....
...delete("test.txt")
rescue
p $! # => #<Errno::ENOENT: No such file or directory @ unlink_internal - test.txt>
end
//}...

File.world_readable?(path) -> Integer | nil (30106.0)

path が全てのユーザから読めるならばそのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。

...返します。そうでない場合は nil を返します。

整数の意味はプラットフォームに依存します。

@param path パスを表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
m = File.world_readable?("/etc/passwd")
"%o" % m...

絞り込み条件を変える

File.world_writable?(path) -> bool (30106.0)

path が全てのユーザから書き込めるならば、そのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。

...返します。そうでない場合は nil を返します。

整数の意味はプラットフォームに依存します。

@param path パスを表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
m = File.world_writable?("/tmp")
"%o" % m...

File.executable?(path) -> bool (30100.0)

FileTest.#executable? と同じです。

...
File
Test.#executable? と同じです。

@param path パスを表す文字列を指定します。...

File.executable_real?(path) -> bool (30100.0)

FileTest.#executable_real? と同じです。

...
File
Test.#executable_real? と同じです。

@param path パスを表す文字列を指定します。...

File.readable?(path) -> bool (30100.0)

FileTest.#readable? と同じです。

...
File
Test.#readable? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。...
<< 1 2 3 ... > >>