open

File.open(filename, mode="r" [, opt]) â file
File.open(filename [, mode [, perm]] [, opt]) â file
File.open(filename, mode="r" [, opt]) {|file| block } â obj
File.open(filename [, mode [, perm]] [, opt]) {|file| block } â obj
Class Public methods

With no associated block, File.open is a synonym for ::new. If the optional code block is given, it will be passed the opened file as an argument and the File object will automatically be closed when the block terminates. The value of the block will be returned from File.open.

If a file is being created, its initial permissions may be set using the perm parameter. See ::new for further discussion.

See IO.new for a description of the mode and opt parameters.

doc_ruby_on_rails
2015-04-06 11:07:27
Comments
Leave a Comment

Please login to continue.