るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.011秒)

別のキーワード

  1. _builtin owned?
  2. pathname owned?
  3. monitor mon_owned?
  4. file owned?
  5. stat owned?

ライブラリ

検索結果

FileTest.#owned?(file) -> bool (54304.0)

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

...IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "")
File.chown(Process.uid, -1, "testfile")
FileTest
.owned?("testfile") # => true
File.chown(501, -1, "testfile")
FileTest
.owned?("testfile") # => false
//}...

FileTest.#grpowned?(file) -> bool (18304.0)

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

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

//emlist[例][ruby]{
IO.write("testfile", "")
File.chown(-1, Process.gid, "testfile")
FileTest
.grpowned?("testfile") # => true
File.chown(-1, Process.gid + 10, "testfile")
FileTest
.grpowned?("testfile") # => false
//}...