3件ヒット
[1-3件を表示]
(0.063秒)
クラス
-
File
:: Stat (2) - IO (1)
キーワード
-
close
_ on _ exec= (1) - directory? (1)
- ftype (1)
検索結果
-
File
:: Stat # directory? -> bool (27649.0) -
ディレクトリの時に真を返します。
ディレクトリの時に真を返します。
//emlist[][ruby]{
p File::Stat.new($0).directory? #=> false
//}
@see FileTest.#directory? -
IO
# close _ on _ exec=(bool) (18328.0) -
自身に close-on-exec フラグを設定します。
自身に close-on-exec フラグを設定します。
このフラグをセットすると exec(2) 時にそのファイルデスクリプタを
close します。
@see fcntl(2)
@param bool 自身の close-on-exec フラグを true か false で指定します。
f = open("/dev/null")
f.close_on_exec = true
system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory
... -
File
:: Stat # ftype -> String (9046.0) -
ファイルのタイプを表す文字列を返します。
ファイルのタイプを表す文字列を返します。
文字列は以下のうちのいずれかです。
"file"
"directory"
"characterSpecial"
"blockSpecial"
"fifo"
"link"
"socket"
"unknown"
//emlist[例][ruby]{
fs = File::Stat.new($0)
p fs.ftype #=> "file"
p File::Stat.new($:[0]).ftype #=> "directory"
//}
1.8 以降では、属性メソッドがシステムでサポートされていない場合 nil...