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

Home » Public Forums » archive » Re: Directory separators
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: Directory separators [message #23758] Tue, 13 February 2001 09:43 Go to next message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
Ben Tupper <btupper@bigelow.org> wrote:

> Howdy,
>
> I have been using the following function to select the appropriate OS
> specific directory separator. I have two questions about it: (1) what
> is the correct directory separator in VMS?,

VMS uses brackets to enclose the directory information as a whole
and periods to delimit subdirectory names. In case of logical names
more than one pair of brackets may occur...

> and (2) is there a built-in
> means of getting the same information?

You may use filepath to set a file name independend of on OS.
Parts of the directory will be given as elements of a string
array.

Norbert
Re: Directory separators [message #23760 is a reply to message #23758] Tue, 13 February 2001 08:32 Go to previous messageGo to next message
Dave Greenwood is currently offline  Dave Greenwood
Messages: 33
Registered: October 2000
Member
Ben Tupper <btupper@bigelow.org> wrote:
> Howdy,
>
> I have been using the following function to select the appropriate OS
> specific directory separator. I have two questions about it: (1) what
> is the correct directory separator in VMS?, and (2) is there a built-in
> means of getting the same information?
>
> Thanks,
>
> Ben
>
> ;------START
> FUNCTION SYSSEP
>
> Case StrLowCase(!Version.OS_Family) of
> 'unix': Return, '/'
> 'win': Return,'\'
> 'macos': Return,':'
> 'vms': Return, ''
> Else: Return, ''
> EndCase
>
> End
> ;---------END

Paul van Delst is correct that "." separates subdirectories in VMS.
However, the most frequent use that I've seen for a case statement like
the above is to separate the directory specification from a file name.
In that case you'd want "]". To complete Paul's example:

DISK$NAME1:[PAULV.DIR.SUBDIR.SUBSUBDIR]filename.ext

Dave
--------------
Dave Greenwood Email: Greenwoodde@ORNL.GOV
Oak Ridge National Lab %STD-W-DISCLAIMER, I only speak for myself
Re: Directory separators [message #23761 is a reply to message #23760] Tue, 13 February 2001 08:18 Go to previous messageGo to next message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Ben Tupper wrote:
>
> Howdy,
>
> I have been using the following function to select the appropriate OS
> specific directory separator. I have two questions about it: (1) what
> is the correct directory separator in VMS?

I believe it's '.' as in DISK$NAME1:[PAULV.DIR.SUBDIR.SUBSUBDIR]

> , and (2) is there a built-in
> means of getting the same information?

in idl? don't know. I would prefer your method anyway.

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
pvandelst@ncep.noaa.gov Alexander Pope.
Re: Directory separators [message #24447 is a reply to message #23760] Wed, 28 March 2001 14:41 Go to previous message
George Constantinides is currently offline  George Constantinides
Messages: 16
Registered: July 2000
Junior Member
>
>>
>> I have been using the following function to select the appropriate OS
>> specific directory separator. I have two questions about it: (1) what
>> is the correct directory separator in VMS?, and (2) is there a built-in
>> means of getting the same information?
>>
>> Thanks,
>>
>> Ben
>>
>> ;------START
>> FUNCTION SYSSEP
>>
>> Case StrLowCase(!Version.OS_Family) of
>> 'unix': Return, '/'
>> 'win': Return,'\'
>> 'macos': Return,':'
>> 'vms': Return, ''
>> Else: Return, ''
>> EndCase
>>
>> End
>> ;---------END
>
> Paul van Delst is correct that "." separates subdirectories in VMS.
> However, the most frequent use that I've seen for a case statement like
> the above is to separate the directory specification from a file name.
> In that case you'd want "]". To complete Paul's example:
>
> DISK$NAME1:[PAULV.DIR.SUBDIR.SUBSUBDIR]filename.ext
>

In VMS you may also get a file path define via a logical such as:

$ DEFINE DIR_PATH DISK$NAME1:[PAULV.DIR.SUBDIR.SUBSUBDIR]

in which case the above file spec becomes DIR_PATH:filename.ext

So you also need to search for ":" as well as "]". To do this you can
use a regular expression as show below.

;----------------------------------------------------------- --

Function ExtrFileName, FullFileSpec

; Given the full file spec extract the file name. (vms case)

f= StrSplit(FullFileSpec,'^*:|^*\]',/Extract)
f = f[N_Elements(f)-1]
f= StrSplit(f,';*$',/Extract)

Return, f[0]

End

;----------------------------------------------------------- ---
Regards,

George Constantinides
Manly Hydraulics Laboratory
email: GeorgeC@mhl.nsw.gov.au
URL http://www.mhl.nsw.gov.au
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Optimized IDL machines and license question
Next Topic: MPI_Plot Was: Something else

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

Current Time: Wed Oct 08 15:21:32 PDT 2025

Total time taken to generate the page: 0.00678 seconds