J
JT Kimbell
Hi,
I may be wrong, but after some testing it appears to me that when I
attempt to create a new file using File.new in a directory that does not
exist, instead of creating the directory, an exception is thrown
instead.
To give some background, I am archiving an email listserv so it can be
searched. I've given the listserv administrator the ability to upload a
word document which is parsed and converted into a text file, and stored
both in a database and in a folder hierarchy on the filesystem. The
folder hierarchy starts with folders of each year (2001, 2002, etc), and
each year contains one folder per month (05.2004, 10.2004, etc). So
when a listserv posting from May, 2007 is added, it would go to
"somedir/2007/05.2007/posting_name.txt". I've had no problems when the
folder already exists, but I would like it to be able to create the new
directories needed when a posting from a new month or year is added, so
we don't have to continually add new folders to keep things running
smoothly.
Can anyone direct me to a function, flag, or strategy to achieve what I
am looking for?
Thanks,
JT
I may be wrong, but after some testing it appears to me that when I
attempt to create a new file using File.new in a directory that does not
exist, instead of creating the directory, an exception is thrown
instead.
To give some background, I am archiving an email listserv so it can be
searched. I've given the listserv administrator the ability to upload a
word document which is parsed and converted into a text file, and stored
both in a database and in a folder hierarchy on the filesystem. The
folder hierarchy starts with folders of each year (2001, 2002, etc), and
each year contains one folder per month (05.2004, 10.2004, etc). So
when a listserv posting from May, 2007 is added, it would go to
"somedir/2007/05.2007/posting_name.txt". I've had no problems when the
folder already exists, but I would like it to be able to create the new
directories needed when a posting from a new month or year is added, so
we don't have to continually add new folders to keep things running
smoothly.
Can anyone direct me to a function, flag, or strategy to achieve what I
am looking for?
Thanks,
JT