Re: Making a directory in an IDL routine. [message #10443] |
Thu, 04 December 1997 00:00 |
rpete
Messages: 2 Registered: September 1996
|
Junior Member |
|
|
David Kennedy (D.Kennedy@qub.ac.uk) wrote:
> An usual request -
> Does anyone know how to make a directory from inside an IDL
> routine? I know its odd, but its the best way to organise
> a huge save set that'll be generated.
> (And better yet, how to check if such a directory already
> exists).
> I imagine that this is machine dependant - UNIX answers
> only needed.
'spawn' can do both of these
1. To check if a directory exists:
IDL> dir='/home/me/mydir'
IDL> spawn, 'ls -a '+dir, result
Now, check the length of RESULT[0]. If it is zero, then
DIR doesn't exist, otherwise DIR does exist.
2. To create a directory
IDL> spawn,'mkdir '+dir
This may not be elegant, but it works.
-------------
Peter Ratzlaff Harvard-Smithsonian Center for Astrophysics
Office B102 60 Garden St, MS 21, Cambridge MA 02138 USA
<pratzlaff@cfa.harvard.edu> phone: 617 496 7714
|
|
|