るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. rexml end_element

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 > >>

IO#close_write -> nil (18214.0)

書き込み用の IO を close します。

...ンされていなければ発生します。

@raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writing
end

//}

@see IO#close, IO#closed?, IO#close_read...

ruby 1.6 feature (582.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
...
...パイプの dup を close_write するとエラーになっていました。
((<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-duple...
..."#"
0

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i586-linux]
"\\#"
nil


: 2002-04-29: rb_find_file()

$SAFE >= 4 で、絶対パス指定でない場合、SecurityError 例外が発生する
ようになり...

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

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

...ジェクトは多くのメソッドを IO や File に委譲します。

* 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#intern...
...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 や File に委譲します。

* 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#intern...
...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...

IO#close_read -> nil (113.0)

読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。

...オープンされていなければ発生します。

@raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
IO.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end

//}

@see IO#close, IO#closed?, IO#close_write...

絞り込み条件を変える

ruby 1.8.3 feature (108.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...た。

$ cat mthd_taint.rb
th = Thread.new{
$SAFE = 3
class Hoge
def foo
puts "safe level: #{$SAFE}"
end

end

}
th.join
p $SAFE
Hoge.new.foo

$ ruby-1.8.2 mthd_taint.rb
0
"safe level: 0"

$ ruby-1.8.3 mthd_ta...
...オプションに -w を付けた時に出ます。((<ruby-dev:26201>))

=== 2005-05-22
: OpenSSL::SSL::SSLServer#initialize(svr, ctx, session_id=nil)
session_id を受け付けるようになりました。((<ruby-core:4663>))

=== 2005-05-19
: REXML::Encoding#decode_sjis [lib] [bug]
: REXML::...
...put_encoding=で設定したエンコーディングへ変換されます。

: StringIO [lib] [compat]
close, close_read, close_write が ((<IO>)) と同じように、
nil
を返すようになりました。((<ruby-dev:25623>))

=== 2005-01-29

: Resolv::DNS::Resource::IN::SRV [lib] [new]...

IO.popen("-", mode = "r", opt={}) -> IO (36.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...を返し、子プロセスでは
nil
を返します。

io = IO.popen("-", "r+")
if io # parent
io.puts "foo"
p io.gets # => "child output: foo\n"
io.close
else # child
s = gets
print "child output: " + s
exit
end


ブロックを与えられ...
...されます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end

}
# => "child output: foo\n"

opt...

IO.popen("-", mode = "r", opt={}) {|io| ... } -> object (36.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...を返し、子プロセスでは
nil
を返します。

io = IO.popen("-", "r+")
if io # parent
io.puts "foo"
p io.gets # => "child output: foo\n"
io.close
else # child
s = gets
print "child output: " + s
exit
end


ブロックを与えられ...
...されます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end

}
# => "child output: foo\n"

opt...

IO.popen(env, "-", mode = "r", opt={}) -> IO (36.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...を返し、子プロセスでは
nil
を返します。

io = IO.popen("-", "r+")
if io # parent
io.puts "foo"
p io.gets # => "child output: foo\n"
io.close
else # child
s = gets
print "child output: " + s
exit
end


ブロックを与えられ...
...されます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end

}
# => "child output: foo\n"

opt...

IO.popen(env, "-", mode = "r", opt={}) {|io| ... } -> object (36.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...を返し、子プロセスでは
nil
を返します。

io = IO.popen("-", "r+")
if io # parent
io.puts "foo"
p io.gets # => "child output: foo\n"
io.close
else # child
s = gets
print "child output: " + s
exit
end


ブロックを与えられ...
...されます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
else # child
s = gets
puts "child output: " + s
end

}
# => "child output: foo\n"

opt...

絞り込み条件を変える

<< 1 2 3 > >>