does any one have tried to create a folder from a ROR command.
in my application i want to check weather their is existing folder with
a given name and if it does not exists to make a new folder.
is some one have tried this pls tell me how to achieve this
See the ruby docs, in particular the File and Dir class.
File.directory?(file_name) => true or false
Returns true if the named file is a directory, false otherwise.
File.directory?(".")
Dir.mkdir( string [, integer] ) => 0
Makes a new directory named by string, with permissions specified by the
optional parameter anInteger. The permissions may be modified by the
value
of File::umask, and are ignored on NT. Raises a SystemCallError if the
directory cannot be created. See also the discussion of permissions in
the
class documentation for File.
-philip
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.