るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

File.delete(*filename) -> Integer (9307.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 (9207.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.executable?(path) -> bool (9201.0)

FileTest.#executable? と同じです。

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

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

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

FileTest.#executable_real? と同じです。

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

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

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

FileTest.#file? と同じです。

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

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

絞り込み条件を変える

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

FileTest.#readable? と同じです。

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

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

File.readable_real?(path) -> bool (9201.0)

FileTest.#readable_real? と同じです。

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

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

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

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

...場合は nil を返します。

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

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

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

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

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

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

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

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

//emlist[例][ruby]{
m = File.world_writable?("/tmp")
"%o" % m #=> "777"
//}...
...でない場合は nil を返します。

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

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

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

File.writable?(path) -> bool (9201.0)

FileTest.#writable? と同じです。

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

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

絞り込み条件を変える

<< 1 2 3 ... > >>