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

Home » Public Forums » archive » Re: Creating Directories
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Creating Directories [message #16192] Wed, 07 July 1999 00:00 Go to next message
davidf is currently offline  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 #16193 is a reply to message #16192] Wed, 07 July 1999 00:00 Go to previous messageGo to next message
Jessica Kim is currently offline  Jessica Kim
Messages: 1
Registered: July 1999
Junior Member
Wow!! Thank you so much! That is exactly what I needed!!!
All you guys rule!

jess

Martin LUETHI GL A8.1 2-4092 wrote:
>
> Jessica
>
> You could try the spawn command like this
>
> mydirectory='newdir'
> spstr = 'mkdir '+mydirectory
> SPAWN,spstr,/sh
>
> Cheers
>
> Martin
> --
> ============================================================
> Martin Luethi Tel. +41 1 632 40 92
> Glaciology Section Fax. +41 1 632 11 92
> VAW ETH Zuerich
> CH-8092 Zuerich mail luthi@vaw.baum.ethz.ch
> Switzerland
> ============================================================
Re: Creating Directories [message #16205 is a reply to message #16192] Wed, 07 July 1999 00:00 Go to previous messageGo to next message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Martin Schultz, mgs@io.harvard.edu writes:

> 6 lines versus 3. Viva Unix (and it's flavors!)

Ahem.

do_apple_script, ['tell application "Finder"', $
' make new folder at item "'+path+'"', $
' select result', $
' set name of selection to "'+newdir+'"',$
'end tell']


Tsch��,

Struan
Re: Creating Directories [message #16206 is a reply to message #16192] Wed, 07 July 1999 00:00 Go to previous messageGo to next message
luthi is currently offline  luthi
Messages: 20
Registered: March 1999
Junior Member
Martin Schultz wrote

> 6 lines versus 3. Viva Unix (and it's flavors!)

actually it's one single line:

SPAWN,'mkdir '+mydirectory,/sh

cheers

Martin
--
============================================================
Martin Luethi Tel. +41 1 632 40 92
Glaciology Section Fax. +41 1 632 11 92
VAW ETH Zuerich
CH-8092 Zuerich mail luthi@vaw.baum.ethz.ch
Switzerland
============================================================
Re: Creating Directories [message #16210 is a reply to message #16192] Tue, 06 July 1999 00:00 Go to previous messageGo to next message
Martin Schultz is currently offline  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 #16222 is a reply to message #16210] Tue, 06 July 1999 00:00 Go to previous messageGo to next message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
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
Re: Creating Directories [message #16223 is a reply to message #16210] Tue, 06 July 1999 00:00 Go to previous messageGo to next message
luthi is currently offline  luthi
Messages: 20
Registered: March 1999
Junior Member
Jessica

You could try the spawn command like this

mydirectory='newdir'
spstr = 'mkdir '+mydirectory
SPAWN,spstr,/sh

Cheers

Martin
--
============================================================
Martin Luethi Tel. +41 1 632 40 92
Glaciology Section Fax. +41 1 632 11 92
VAW ETH Zuerich
CH-8092 Zuerich mail luthi@vaw.baum.ethz.ch
Switzerland
============================================================
Re: Creating Directories [message #16241 is a reply to message #16210] Tue, 13 July 1999 00:00 Go to previous message
Harald Frey is currently offline  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 Go to previous message
trondsen is currently offline  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 |
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Union in IDL?
Next Topic: Re: Creating a Runtime App using Object Graphics

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

Current Time: Wed Oct 08 16:01:00 PDT 2025

Total time taken to generate the page: 0.00849 seconds