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

Home » Public Forums » archive » Re: UNIX v. Windows Filepaths
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: UNIX v. Windows Filepaths [message #35736 is a reply to message #35735] Thu, 10 July 2003 12:32 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 10 Jul 2003 07:58:09 -0700, Justin Sieglaff wrote:

> Hi everyone....
>
> A quick question. I've created code and after it is installed on a
> user's machine I want to make the current directory one of the
> directories included with the code. For UNIX I've added the following
> code:
>
> CD, '../source', current=currdir
>
> Since I have never used IDL for Windows I'm not sure how to add a line
> for Windows path. Any help would be greatly appreciated!
>

I use an altogether different method to accomplish the same thing,
which never requires any specific knowledge about the path delimiters,
etc.:

source=(routine_info('irs_calib_dir_marker',/SOURCE)).PATH
dir=strmid(source,0,strpos(source,path_sep(),/REVERSE_SEARCH ))

where the procedure `irs_calib_dir_marker' exists in the directory I'm
after. You can either use an empty marker procedure, or an actual
procedure. The advantage of this method is that your run-time
required data or directory will be found with the associated routine
independent of how IDL was started, and even if the user has severely
butchered the file structure of your distribution (moving various
directories around, say).

You can also create directories or files relative to this in a
platform-independent way using, e.g.:

file=filepath(ROOT_DIR=cdir,SUBDIR='my_data',file)

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: User Functions for ENVI
Next Topic: IDL 6.0 Seminar Series

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

Current Time: Sun Oct 12 12:35:12 PDT 2025

Total time taken to generate the page: 0.95977 seconds