るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

クラス

キーワード

検索結果

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...