comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Making a directory in an IDL routine.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Making a directory in an IDL routine. [message #10443] Thu, 04 December 1997 00:00
rpete is currently offline  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
[Message index]
 
Read Message
Previous Topic: Re: opinions needed on IDL, PV-WAVE
Next Topic: Q: background of text ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:12:31 PDT 2025

Total time taken to generate the page: 0.00427 seconds