るりまサーチ

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

別のキーワード

  1. rexml/document write
  2. _builtin write
  3. io write
  4. tuple write
  5. stringio write

ライブラリ

モジュール

キーワード

検索結果

FileTest.#empty?(file) -> bool (18112.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

FileTest.#zero?(file) -> bool (3012.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

net/pop (48.0)

このライブラリは、POP3 (Post Office Protocol version 3) を 用いてPOPサーバからメールを受信する機能を提供するライブラリです。

...sword') # POPのセッションを開始
if pop.mails.empty?
$stderr.puts 'no mail.'
else
pop.mails.each_with_index do |m, idx| # 各メッセージにアクセスする
File.open("inbox/#{idx + 1}", 'w') {|f|
f.write m.pop
}
m.delete
end
$stderr.puts "...
...'YourAccount', 'YourPassword') {|pop|
if pop.mails.empty?
$stderr.puts 'no mail.'
else
pop.mails.each_with_index do |m, idx|
File.open("inbox/#{idx + 1}", 'w') {|f|
f.write m.pop
}
m.delete
end
$stderr.puts "#{pop.ma...
...110,
'YourAccount', 'YourPassword') {|pop|
if pop.mails.empty?
$stderr.puts 'no mail.'
else
i = 0
pop.delete_all do |m|
File.open("inbox/#{i}", 'w') {|f|
f.write m.pop
}
i += 1
end
end
}

クラスメソッド...