るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.057秒)
トップページ > クエリ:IO[x] > クエリ:write[x] > クエリ:test[x] > クエリ:writable?[x]

別のキーワード

  1. rexml/document write
  2. _builtin write
  3. io write
  4. stringio write
  5. tuple write

ライブラリ

モジュール

検索結果

FileTest.#writable?(file) -> bool (21118.0)

ファイルがカレントプロセスにより書き込み可能である時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...false を返します。

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

//emlist[例][ruby]{
IO
.write("testfile", "test")
File.chmod(0600, "testfile")
FileTest.writable?("testfile") # => true
File.chmod(0400, "testfile")
FileTest.writable?("testfile") # => false
//}...