Re: Creating Directories [message #16192] |
Wed, 07 July 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Jessica Kim (jkim@stsci.edu) writes:
> Wow!! Thank you so much! That is exactly what I needed!!!
> All you guys rule!
Wow! Let's just say I'm gonna be showing up here even
more than I have in the past. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
|
|
Re: Creating Directories [message #16210 is a reply to message #16192] |
Tue, 06 July 1999 00:00   |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Struan Gray wrote:
>
> Just for completeness, here's how I do it on a Mac:
>
> script = 'tell application "Finder"'
> script = [script, ' make new folder at item "'+path+'"']
> script = [script, ' select result']
> script = [script, ' set name of selection to "'+newdir+'"']
> script = [script, 'end tell']
> do_apple_script, script
>
> How do the Slaves Of Gates do it?
>
> Struan
6 lines versus 3. Viva Unix (and it's flavors!)
(still shorter than my signature at the moment ;-)
--
|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
********* ADDRESS CHANGE : AFTER JULY 15, 1999 ***************
Max-Planck-Institut fuer Meteorologie >>> N E W <<<
Bundesallee 55 >>> N E W <<<
20147 Hamburg >>> N E W <<<
Germany >>> N E W <<<
phone (+49 40) 41173 - 0 >>> N E W <<<
email martin.schultz@dkrz.de >>> N E W <<<
(email to mgs@io.harvard.edu will be forwarded)
************************************************************ *******
|
|
|
|
|
Re: Creating Directories [message #16241 is a reply to message #16210] |
Tue, 13 July 1999 00:00  |
Harald Frey
Messages: 41 Registered: March 1997
|
Member |
|
|
Trond Trondsen wrote:
> The solutions presented in this thread all seem to be unacceptable
> in view of the fact that IDL is, in principle, platform independent.
> I was contracted to write a piece of widget software that is supposed
> to run under unix/linux (the only platform *I* am able to stomach),
> VMS, Mac, as well as MS-Win/99 (or whatever it's called now). I happen to need
> to create subdirectories recursively and so on -- so, if I may ask,
> where is the IDL command to do directory creation platform independently.
> Independent like FILEPATH, for example. If I had direct access to all the
> different platforms I could of course easily write my own function using
> the !VERSION system variable. Let me know if anybody comes up with a
> CREATEDIR command for IDL. :-) -trond
>
This may not be the "perfect and complete" answer, but what I do to run a program
on different platforms is to use a batch file which defines the common blocks
(oh, yes I use common blocks!) and defines the platform specific path names,
directory separators etc.
Here is the main part of the batch file as an example:
========== snipped some code here ==========
; on which computer is it running
; this list can be extended in future if neccessary
; you have to edit this datapath and the filepath for the programs
case !version.arch of $
"sparc": begin $
data_path='/disks/sprite/disk2/hfrey/ago/' &$
file_path='/disks/sprite/disk1/hfrey/idl/ago/' &$
dir_sep='/' &$
dev_name='X' &$
end &$
"PowerMac": begin $
data_path='+Hard Disk:applications:IDL:IDL 4.0:ago' &$
file_path='+Hard Disk:applications:IDL:IDL 4.0:ago' &$
dir_sep=':' &$
dev_name='MAC' &$
end &$
"alpha": begin $
data_path='[hfr.idl.ago.data' &$
file_path='[hfr.idl.ago ' &$
dir_sep='.' &$
dev_name='X' &$
end &$
else: begin $
print,'You have to edit the case statement in ago_config.cmn' &$
stop &$
end &$
endcase
================ end of batch ==============================
All my procedures call this batch at the beginning with
@ago_config.cmn
and you might include the platform specific differences in the directory creation
here as well.
Harald
hfrey@ssl.berkeley.edu
|
|
|
Re: Creating Directories [message #16249 is a reply to message #16210] |
Tue, 13 July 1999 00:00  |
trondsen
Messages: 1 Registered: July 1999
|
Junior Member |
|
|
The solutions presented in this thread all seem to be unacceptable
in view of the fact that IDL is, in principle, platform independent.
I was contracted to write a piece of widget software that is supposed
to run under unix/linux (the only platform *I* am able to stomach),
VMS, Mac, as well as MS-Win/99 (or whatever it's called now). I happen to need
to create subdirectories recursively and so on -- so, if I may ask,
where is the IDL command to do directory creation platform independently.
Independent like FILEPATH, for example. If I had direct access to all the
different platforms I could of course easily write my own function using
the !VERSION system variable. Let me know if anybody comes up with a
CREATEDIR command for IDL. :-) -trond
--
+------------------------------------------------------+
| Trond S. Trondsen trondsen@phys.ucalgary.ca [VE6NOR] |
| Institute for Space Research - Calgary, AB, Canada |
|
|
|