るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

IO#close_on_exec=(bool) (69001.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
...