219件ヒット
[1-100件を表示]
(0.029秒)
ライブラリ
- ビルトイン (144)
- fileutils (33)
- pathname (12)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- File (48)
-
File
:: Stat (36) - Pathname (12)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
検索結果
先頭5件
-
File
:: Stat # uid -> Integer (21113.0) -
オーナーのユーザIDを返します。
...オーナーのユーザIDを返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.uid #=> 0
//}... -
File
. setuid?(path) -> bool (15100.0) -
FileTest.#setuid? と同じです。
...
FileTest.#setuid? と同じです。
@param path パスを表す文字列か IO オブジェクトを指定します。... -
FileTest
. # setuid?(file) -> bool (9213.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") # => fal... -
File
. lchown(owner , group , *filename) -> Integer (9164.0) -
File#chown と同様ですが、 シンボリックリンクに関してリンクそのもののオーナー、 グループを変更します。
...
File#chown と同様ですが、
シンボリックリンクに関してリンクそのもののオーナー、
グループを変更します。
@param filename ファイル名を表す文字列を指定します。
@param owner chown(2) と同様に数値で指定します。nil または -1......発生します。
//emlist[例][ruby]{
IO.write("testfile", "test")
File.symlink("testfile", "testlink")
File.chown(501, -1, "testfile")
File.lstat("testlink").ftype # => "link"
File.lchown(0, -1, "testlink")
File.stat("testlink").uid # => 501
File.lstat("testlink").uid # => 0
//}... -
File
. chown(owner , group , *filename) -> Integer (9124.0) -
ファイルのオーナーとグループを変更します。スーパーユーザだけがファ イルのオーナーとグループを変更できます。変更を行ったファイルの数を 返します。
...ユーザだけがファ
イルのオーナーとグループを変更できます。変更を行ったファイルの数を
返します。
@param filename ファイル名を表す文字列を指定します。
@param owner chown(2) と同様に数値で指定します。nil または -1 を指......を指定することで、グループを現在のままにすることができます。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("test.txt", "test")
File.chown(502, 12, "test.txt")
File.stat("test.txt").uid # => 502
//}
@see File#chown... -
File
:: Stat # setuid? -> bool (9106.0) -
setuidされている時に真を返します。
...setuidされている時に真を返します。
//emlist[][ruby]{
Dir.glob("/bin/*") {|bd|
if File::Stat.new(bd).setuid?
puts bd
end
}
#例
#...
#=> /bin/ping
#=> /bin/su
#...
//}... -
File
# chown(owner , group) -> 0 (9030.0) -
ファイルのオーナーとグループを変更します。
...ます。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例][ruby]{
File.open("testfile") { |f| f.chown(502, 1000) } # => 0
File.stat("testfile").uid # => 502
File.stat("testfile").gid # => 1000
//}
@see File.chown... -
Shell
# setuid?(file) -> bool (6207.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
...FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#setuid?... -
Shell
:: CommandProcessor # setuid?(file) -> bool (6207.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
...FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#setuid?... -
Shell
:: Filter # setuid?(file) -> bool (6207.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
...FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#setuid?...