るりまサーチ

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

別のキーワード

  1. csv fcntl
  2. stringio fcntl
  3. fcntl o_rdwr
  4. fcntl o_excl
  5. fcntl f_setlk

クラス

検索結果

IO#fcntl(cmd, arg = 0) -> Integer (18242.0)

IOに対してシステムコール fcntl を実行します。 機能の詳細は fcntl(2) を参照してください。 fcntl(2) が返した整数を返します。

...システムコール fcntl を実行します。
機能の詳細は fcntl(2) を参照してください。
fcntl
(2) が返した整数を返します。

@
param cmd IO に対するコマンドを、添付ライブラリ fcntl が提供している定数で指定します。

@
param arg cmd に対...
...の時にはその値を fcntl(2) に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の場合には 0を、true の場合には 1 を渡します。

@
raise Errno::EXXX fcntl の実行に失敗した場...
...ます。

@
raise IOError 既に close されている場合に発生します。

//emlist[例][ruby]{
require "fcntl"

IO.write("testfile", "abcde")
# ファイル状態フラグを読み出す
File.open("testfile") do |f|
f.fcntl(Fcntl::F_GETFL, 0) # => 0
f.fcntl(Fcntl::F_SETFL, Fcntl::O_NONB...

IO#close_on_exec=(bool) (27.0)

自身に close-on-exec フラグを設定します。

...

@
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
f.closed? #=> false

@
see IO#...