るりまサーチ

最速Rubyリファレンスマニュアル検索!
78件ヒット [1-78件を表示] (0.029秒)
トップページ > クエリ:nil[x] > クエリ:end[x] > クエリ:fcntl[x]

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. _builtin nil
  5. object nil

ライブラリ

クラス

検索結果

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

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

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

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

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

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

//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_NONBLOCK) # => 0
f.fcntl(Fcntl::F_GETFL, 0) # => 4
end

//}...

ruby 1.6 feature (588.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

... nil
を返すようになりました。(String#[]やString#slice と同じ結果を返すと
いうことです)

p "foo".slice!("bar") # <- 以前からこちらは nil を返していた
p "foo".slice!(5,10)

=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
...
...ーになっていました。
((<ruby-dev:17155>))

open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end

}

=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex IO for writing (IOError)
from -:3...
...-03-19) [i586-linux]
nil

nil

nil

nil


: 2002-03-14 拡張ライブラリの autoload

拡張ライブラリに対して autoload が効いていませんでした。((<ruby-dev:16379>))

autoload :Fcntl, "fcntl"
require "fcntl"

=> -:2:in `re...

CSV.open(filename, mode = "rb", options = Hash.new) {|csv| ... } -> nil (120.0)

このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。

...IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#internal_encoding
* IO#ioctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
*...
...n("test.csv", headers: true) do |csv|
csv.class # => CSV
csv.first # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
end

//}

//emlist[例 書き込み・ブロック指定あり][ruby]{
require "csv"

CSV.open("test.csv", "w") do |csv|
csv << ["id", "first name", "...
...v << ["1", "taro", "tanaka", "20"]
csv << ["2", "jiro", "suzuki", "18"]
csv << ["3", "ami", "sato", "19"]
csv << ["4", "yumi", "adachi", "21"]
end

print File.read("test.csv")

# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21...

CSV.open(filename, options = Hash.new) {|csv| ... } -> nil (120.0)

このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。

...IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#internal_encoding
* IO#ioctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
*...
...n("test.csv", headers: true) do |csv|
csv.class # => CSV
csv.first # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
end

//}

//emlist[例 書き込み・ブロック指定あり][ruby]{
require "csv"

CSV.open("test.csv", "w") do |csv|
csv << ["id", "first name", "...
...v << ["1", "taro", "tanaka", "20"]
csv << ["2", "jiro", "suzuki", "18"]
csv << ["3", "ami", "sato", "19"]
csv << ["4", "yumi", "adachi", "21"]
end

print File.read("test.csv")

# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21...

NEWS for Ruby 3.1.0 (96.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ッドに渡されるだけの場合は、ブロックの引数を無名にできるようになりました。 11256

//emlist{
def foo(&)
bar(&)
end

//}

* ピン演算子に式を書けるようになりました。 17411

//emlist{
Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3...
....com/ruby/ruby/pull/1509

//emlist[Enumerable#each_cons Enumerable#each_slice][ruby]{
[1, 2, 3].each_cons(2){}
# 3.0 => nil
# 3.1 => [1, 2, 3]

[1, 2, 3].each_slice(2){}
# 3.0 => nil
# 3.1 => [1, 2, 3]
//}

* Enumerator::Lazy
* 新規メソッド
* Enumerator::Lazy#compact が追加さ...
....2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0
* drb 2.1.0
* erb 2.2.3
* error_highlight 0.3.0
* etc 1.3.0
* fcntl 1.0.1
* fiddle 1.1.0
* fileutils 1.6.0
* find 0.1.1
* io-console 0.5.10
* io-wait 0.2.1
* ipaddr 1.2.3
* irb 1.4.1...

絞り込み条件を変える

NEWS for Ruby 2.5.0 (78.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加...
...7688
* 数値の比較メソッド(<,<=,>=,>)は、coerceメソッドで発生した例外を隠蔽しなくなりました。
coerceがnilを返す場合、変換は不可能です。7688

* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しまし...
...* 以下の標準添付ライブラリをdefault gemsに変更しました
* cmath
* csv
* date
* dbm
* etc
* fcntl
* fiddle
* fileutils
* gdbm
* ipaddr
* scanf
* sdbm
* stringio
* strscan
* webrick
* z...

セキュリティモデル (24.0)

セキュリティモデル RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ 機構が備わっています。

...ile#chmod File#chown File.delete File.unlink
File#truncate File#flock
および FileTest モジュールのメソッド
* IO#ioctl, IO#fcntl
* Process.fork Process.#setpgid Process.#setsid
Process.#setpriority Process.#egid= Process.#kill
* 危険なパスからの Kernel.#lo...
...実行するとその時点で例外 SecurityError が発生する。
* 実装の都合上 Fixnum, Bignum, Float,
Symbol, true, false, nil は汚染されない。

=== 使用例


一旦高くした$SAFEレベルを低く変更する事はできませんが、以下のようにスレ...
...いセーフレベルで実行することが可
能です。

//emlist[例][ruby]{
def safe(level)
result = nil
Thread.start {
$SAFE = level
result = yield
}.join
result
end


lib = "insecure_library".taint # 外部から受け取った文字列(仮)
safe(1) { require lib } #...

CSV.open(filename, mode = "rb", options = Hash.new) -> CSV (20.0)

このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。

...IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#internal_encoding
* IO#ioctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
*...
...n("test.csv", headers: true) do |csv|
csv.class # => CSV
csv.first # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
end

//}

//emlist[例 書き込み・ブロック指定あり][ruby]{
require "csv"

CSV.open("test.csv", "w") do |csv|
csv << ["id", "first name", "...
...v << ["1", "taro", "tanaka", "20"]
csv << ["2", "jiro", "suzuki", "18"]
csv << ["3", "ami", "sato", "19"]
csv << ["4", "yumi", "adachi", "21"]
end

print File.read("test.csv")

# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21...

CSV.open(filename, options = Hash.new) -> CSV (20.0)

このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。

...IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#internal_encoding
* IO#ioctl
* IO#isatty
* File#path
* IO#pid
* IO#pos
*...
...n("test.csv", headers: true) do |csv|
csv.class # => CSV
csv.first # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
end

//}

//emlist[例 書き込み・ブロック指定あり][ruby]{
require "csv"

CSV.open("test.csv", "w") do |csv|
csv << ["id", "first name", "...
...v << ["1", "taro", "tanaka", "20"]
csv << ["2", "jiro", "suzuki", "18"]
csv << ["3", "ami", "sato", "19"]
csv << ["4", "yumi", "adachi", "21"]
end

print File.read("test.csv")

# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21...