From: Matthew Smillie Date: 2006-01-31T02:03:40+09:00 Subject: Re: check for and if not there, create direcory and file On Jan 30, 2006, at 16:39, charlie bowman wrote: > > I'm making a little app that requires this folder .timeclock/filename > > The first time the app runs I would like it to check to see if the > folder and file are there and if not, create them. Everything I've > tried > crashes if the folder isn't there. Thanks for any help! These methods might help you out with creating the directory: irb(main):001:0> File.exist?(".timeclock") => false irb(main):002:0> Dir.mkdir(".timeclock") => 0 irb(main):003:0> File.exist?(".timeclock") => true irb(main):004:0> File.directory?(".timeclock") => true From there you should be able to just open .timeclock/new_file as one normally would. matthew smillie.