るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.028秒)
トップページ > バージョン:2.2.0[x] > クエリ:File[x] > クエリ:chmod[x] > モジュール:FileTest[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file chmod
  4. file chown
  5. file ctime

ライブラリ

キーワード

検索結果

FileTest.#sticky?(file) -> bool (9409.0)

ファイルの sticky ビット(chmod(2) 参照)が 立っている時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...名を表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("o+t", "testfile")
FileTest
.sticky?("testfile") # => true
FileUtils.chmod("o-t", "testfile")
FileTest
.sticky?("testfile") # => false
//}...

FileTest.#executable_real?(file) -> bool (9397.0)

ファイルがカレントプロセスの実ユーザか実グループで実行できる時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ます。

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

//emlist[例][ruby]{
IO.write("empty.txt", "")
File.chmod(0744, "empty.txt")
FileTest
.executable_real?("empty.txt") # => true
File.chmod(0644, "empty.txt")
FileTest
.executable_real?("empty.txt") # => false
//}...

FileTest.#readable?(file) -> bool (9397.0)

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

...は false を返します。

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

//emlist[例][ruby]{
IO.write("testfile", "")
File.chmod(0644, "testfile")
FileTest
.readable?("testfile") # => true
File.chmod(0200, "testfile")
FileTest
.readable?("testfile") # => false
//}...

FileTest.#writable?(file) -> bool (9397.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
//}...

FileTest.#setuid?(file) -> bool (9379.0)

ファイルが setuid(2) されている時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("u+s", "testfile")
FileTest
.setuid?("testfile") # => true
FileUtils.chmod("u-s", "testfile")
FileTest
.setuid?("testfile") # => false
//}...

絞り込み条件を変える

FileTest.#setgid?(file) -> bool (9361.0)

ファイルが setgid(2) されている時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...名を表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("g+s", "testfile")
FileTest
.setgid?("testfile") # => true
FileUtils.chmod("g-s", "testfile")
FileTest
.setgid?("testfile") # => false
//}...