how to pre-create directories on linux for file storage
Posted
by Erik Sorensen
on Server Fault
See other posts from Server Fault
or by Erik Sorensen
Published on 2010-05-07T14:24:03Z
Indexed on
2010/05/07
14:30 UTC
Read the original article
Hit count: 405
Hi - looking for a way to pre-create directories on linux to be used to store a large number of files.
We will be generating file ids using a GUID - I need to keep a copy of these files on a linux web server. I plan on using subdirectories to split up the files (it's ext3)... so for example, the filename 055c102b-62fb-4671-a3c7-68b9515ec53e.swf would live in /data/files/0/5/5/055c102b-62fb-4671-a3c7-68b9515ec53e.swf (taking the first 3 characters as directory names)
My question is - how to create the /data/files/?/?/?/ directories ahead of time? Where ? could be a-z or 0-9
© Server Fault or respective owner