Platform Independent Path
From Erlang Community
[edit] Problem
You want to create a directory in a platform independent way. The directory is several levels deep and you wish to create intermediate directories as necessary.
[edit] Solution
Use the ensure_dir procedure in Erlang's filelib module.
1> filelib:ensure_dir("/what/a/great/test").
ok
|
[edit] Discussion
Although the above directory tree looks like a POSIX file system, if this test is run on a Windows machine you will get the expected directory tree starting at the root of the current drive (usually C:). On a UNIX platform, you will get the expected directory tree.
As always your user permissions will limit what files and directories you are able to create or modify.

Digg It
Del.icio.us
Reddit
Facebook
Stumble Upon
Technorati
Click here to order from amazon.com