ライブラリ
クラス
-
CGI
:: Session :: FileStore (12) - CSV (48)
- Dir (59)
- File (143)
-
File
:: Stat (12) - IO (324)
- Tempfile (72)
- Tracer (12)
-
Zlib
:: GzipFile (48) -
Zlib
:: GzipReader (24) -
Zlib
:: GzipWriter (84)
キーワード
-
$ DEFAULT _ OUTPUT (12) - GzipReader (12)
- GzipWriter (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) - Open3 (12)
- Syslog (12)
- Tempfile (12)
- atime (12)
- birthtime (11)
- blockdev? (12)
- chardev? (12)
- chmod (12)
- chown (12)
- clone (12)
- close! (12)
-
close
_ on _ exec= (12) - closed? (24)
- ctime (12)
- directory? (12)
- dup (12)
- empty? (9)
- eof (12)
- eof? (12)
- exist? (12)
- fcntl (12)
- file? (12)
- fileno (23)
- finish (24)
- flock (12)
-
for
_ fd (12) - grpowned? (12)
- identical? (12)
- isatty (12)
- length (12)
- logger (12)
- lstat (12)
- mask (12)
- mask= (12)
- mtime (12)
-
net
/ smtp (12) - new (48)
- open (156)
-
open
_ uri (24) - owned? (12)
- path (12)
- pipe? (12)
- pos (12)
- pos= (12)
- read (12)
- readchar (12)
- readline (12)
- reopen (36)
- rewind (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) - seek (12)
- setuid? (12)
- size (36)
- size? (24)
- socket? (12)
- spawn (48)
- stat (12)
- stdout= (12)
- sync (12)
- sysseek (12)
- tell (12)
- timeout (21)
-
to
_ i (12) -
to
_ io (12) - tty? (12)
- wrap (24)
- zero? (12)
検索結果
先頭5件
-
Zlib
:: GzipFile # close -> IO (21117.0) -
GzipFile オブジェクトをクローズします。このメソッドは 関連付けられている IO オブジェクトの close メソッドを呼び出します。 関連付けられている IO オブジェクトを返します。
...GzipFile オブジェクトをクローズします。このメソッドは
関連付けられている IO オブジェクトの close メソッドを呼び出します。
関連付けられている IO オブジェクトを返します。... -
Tempfile
# close(real = false) -> nil (21107.0) -
テンポラリファイルをクローズします。 real が偽ならば、テンポラリファイルはGCによって削除されます。 そうでなければ、すぐに削除されます。
...ならば、テンポラリファイルはGCによって削除されます。
そうでなければ、すぐに削除されます。
@param real false もしくはそれ以外を指定します。
require "tempfile"
tf = Tempfile.open("bar")
tf.close
p FileTest.exist?(tf.path) # => true... -
CGI
:: Session :: FileStore # close -> () (21101.0) -
セッションの状態をファイルに保存してファイルを閉じます。
セッションの状態をファイルに保存してファイルを閉じます。 -
Zlib
:: GzipWriter # close -> File (18253.0) -
フッターを書き出し、GzipWriter オブジェクトをクローズします。close と finish の違いは Zlib::GzipFile#close, Zlib::GzipFile#finish を 参照して下さい。
...フッターを書き出し、GzipWriter オブジェクトをクローズします。close と
finish の違いは Zlib::GzipFile#close, Zlib::GzipFile#finish を
参照して下さい。
注意: Ruby の finalizer の制約のため、GzipWriter オブジェクトは
必ずクローズしてく......def case_finish
filename='hoge1.gz'
gz = Zlib::GzipWriter.open(filename, 9)
gz.puts "hogehoge\n" * 100
f = gz.finish
p f.atime
# 例
#=> Sun Jul 06 15:43:57 +0900 2008
end
def case_close
filename='hoge1.gz'
gz = Zlib::GzipWriter.open(filename, 9)
gz.p......uts "hogehoge\n" * 100
f = gz.close
begin
p f.atime
rescue IOError => err
puts err #=> closed stream
end
end
case_finish
case_close... -
IO
# close -> nil (18143.0) -
入出力ポートをクローズします。
...@raise Errno::EXXX close に失敗した場合に発生します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているの......で read できない)
//}
@see IO#closed?, IO#close_read, IO#close_write......。
既に close されていた場合には単に無視されます。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close している......ので read できない)
//}
@see IO#closed?, IO#close_read, IO#close_write... -
FileTest
. # file?(file) -> bool (9244.0) -
ファイルが通常ファイルである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
...aram file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
FileTest.file?('/bin/bash') # => true
FileTest.file?('/bin') # => false
FileTest.......file?('/no_such_file') # => false... -
File
. new(path , mode = "r" , perm = 0666) -> File (9197.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......t[例: File.new による読み込みモードでのファイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close
//}......//emlist[例: File.open による書き込みモードでのファイルオープン][ruby]{
File.open("testfile", "w", 0755) { |f| f.print "test" }
File.read("testfile") # => "test"
//}... -
File
. open(path , mode = "r" , perm = 0666) -> File (9197.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......t[例: File.new による読み込みモードでのファイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close
//}......//emlist[例: File.open による書き込みモードでのファイルオープン][ruby]{
File.open("testfile", "w", 0755) { |f| f.print "test" }
File.read("testfile") # => "test"
//}... -
File
. open(path , mode = "r" , perm = 0666) {|file| . . . } -> object (9197.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......t[例: File.new による読み込みモードでのファイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close
//}......//emlist[例: File.open による書き込みモードでのファイルオープン][ruby]{
File.open("testfile", "w", 0755) { |f| f.print "test" }
File.read("testfile") # => "test"
//}...