るりまサーチ

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

別のキーワード

  1. _builtin uid
  2. uid switch
  3. uid eid
  4. uid rid
  5. uid eid=

ライブラリ

モジュール

キーワード

検索結果

Kernel.#test(cmd, file) -> bool | Time | Integer | nil (18178.0)

単体のファイルでファイルテストを行います。

...の意味です。

: ?r
ファイルを実効 uid で読むことができる
: ?w
ファイルに実効 uid で書くことができる
: ?x
ファイルを実効 uid で実行できる
: ?o
ファイルの所有者が実効 uid である
: ?G
ファイルのグループ所有...
...者が実効 gid である
: ?R
ファイルを実 uid で読むことができる
: ?W
ファイルに実 uid で書くことができる
: ?X
ファイルを実 uid で実行できる
: ?O
ファイルの所有者が実 uid である
: ?e
ファイルが存在する
: ?z...
...クスペシャルファイルである
: ?c
ファイルはキャラクタースペシャルファイルである
: ?u
ファイルに setuid ビットがセットされている
: ?g
ファイルに setgid ビットがセットされている
: ?k
ファイルに sticky ビット...

Kernel.#test(cmd, file1, file2) -> bool (18133.0)

2ファイル間のファイルテストを行います。

...ァイル1とファイル2が同一のファイルである

//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}

# => =: true
# => <: false
# => >: false
# => -: fals...

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

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

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

@param file ファイル名を表す文字列か IO オブジェクトを...
...ト 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.#owned?(file) -> bool (3007.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
//}...