[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkdir?

"Christopher W. O'Dell" wrote:

> Is there anyway to create a directory in your OS from within
> IDL?
> I keep running into problems using the SAVE function, when I
> have forgotten to create the directory to which I am
> saving.  I just want to add a line of code that checks if
> the directory exists, and if it doesn't it makes the
> directory.
> BTW, I'm running on a Windows platform (your are welcome to
> make fun of me at this point...)

If you have V5.4 you can use FILE_TEST( /DIR) to test if  a directory
exists, and FILE_MKDIR to create a directory.     If you have an earlier
IDL version you can try to CD to the directory and catch any errors (as
in  http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/system/is_dir.pro)
and SPAWN to create a directory.