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

Home » Public Forums » archive » Re: how to set path?
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: how to set path? [message #25177] Fri, 25 May 2001 15:05 Go to next message
web is currently offline  web
Messages: 24
Registered: March 2001
Junior Member
Thank you. I set path like you. I donot think it's a good method. When I
change directory, I have to change all, especially when I generate a .sav
file and run on another computer.

Sometimes, When I donot set full path, it can work. But sometimes it cannot.
Why?

"Johnny Lin" <deja_jlin@my-deja.com> wrote in message
news:56528e1a.0105251308.29cfee5f@posting.google.com...
> howdy!
>
> you can append additional directory names to the !Path system variable
> like so:
>
> dir_name1 = '~/prog/idl'
> dir_name2 = '~/arcsym/tools/idl'
>
> !Path = dir_name1 + ':' + !Path
> !Path = dir_name2 + ':' + !Path
>
> the IDL documentation says though that !Path only works for .pro files,
etc.
>
> for data files, i generally prefer specifying a string variable that has
> the entire path in it, and appending it to the filename, like:
>
> pathname = '/users/johnny/datafile'
> filename = 'foo.dat'
> fullname = pathname + '/' + filename
>
> maybe someone else has help on specifying paths for data files.
>
> best,
> -Johnny
>
>
> -------------------------------------------
> Johnny Lin
> CIRES, University of Colorado
> Work Phone: (303) 735-1636
> Web: http://cires.colorado.edu/~johnny/
> -------------------------------------------
>
Re: how to set path? [message #25181 is a reply to message #25177] Fri, 25 May 2001 14:23 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Johnny Lin (deja_jlin@my-deja.com) writes:

> maybe someone else has help on specifying paths for data files.

FILEPATH has always worked well for me. :-)

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: how to set path? [message #25182 is a reply to message #25181] Fri, 25 May 2001 14:08 Go to previous messageGo to next message
deja_jlin is currently offline  deja_jlin
Messages: 12
Registered: February 2001
Junior Member
howdy!

you can append additional directory names to the !Path system variable
like so:

dir_name1 = '~/prog/idl'
dir_name2 = '~/arcsym/tools/idl'

!Path = dir_name1 + ':' + !Path
!Path = dir_name2 + ':' + !Path

the IDL documentation says though that !Path only works for .pro files, etc.

for data files, i generally prefer specifying a string variable that has
the entire path in it, and appending it to the filename, like:

pathname = '/users/johnny/datafile'
filename = 'foo.dat'
fullname = pathname + '/' + filename

maybe someone else has help on specifying paths for data files.

best,
-Johnny


-------------------------------------------
Johnny Lin
CIRES, University of Colorado
Work Phone: (303) 735-1636
Web: http://cires.colorado.edu/~johnny/
-------------------------------------------


"web" <jiali3@21cn.com> wrote in message news:<9eg7f8$c03$2@mail.cn99.com>...
> Hi, I'd like to know how to set path in IDL. For example, my idl program is
> in some directory. In the program, some datafile will be input. If I donot
> set whole path including the directory, there is a falt indicating that the
> data file cannot be found in rsi\idl. I hope that all the file in the same
> directory as idl program will not indict whole path. How to do that? thanks!
Re: how to set path? [message #25307 is a reply to message #25177] Mon, 28 May 2001 18:09 Go to previous message
Michael Asten is currently offline  Michael Asten
Messages: 53
Registered: March 1999
Member
I had a similar problem recently, to do with use of sav files.
When you make a sav file with save, /all , the path is also saved. When the
sav file is read on another computer, the path in the sav file becomes the path,
replacing whatever path you might think the new computer has. This can give
rise to the "sometimes works, sometimes does not" problem. Check the path with
the command
print, !path and see if it what it is meant to be.

Regards,
Michael Asten


web wrote:

> Thank you. I set path like you. I donot think it's a good method. When I
> change directory, I have to change all, especially when I generate a .sav
> file and run on another computer.
>
> Sometimes, When I donot set full path, it can work. But sometimes it cannot.
> Why?
>
> "Johnny Lin" <deja_jlin@my-deja.com> wrote in message
> news:56528e1a.0105251308.29cfee5f@posting.google.com...
>> howdy!
>>
>> you can append additional directory names to the !Path system variable
>> like so:
>>
>> dir_name1 = '~/prog/idl'
>> dir_name2 = '~/arcsym/tools/idl'
>>
>> !Path = dir_name1 + ':' + !Path
>> !Path = dir_name2 + ':' + !Path
>>
>> the IDL documentation says though that !Path only works for .pro files,
> etc.
>>
>> for data files, i generally prefer specifying a string variable that has
>> the entire path in it, and appending it to the filename, like:
>>
>> pathname = '/users/johnny/datafile'
>> filename = 'foo.dat'
>> fullname = pathname + '/' + filename
>>
>> maybe someone else has help on specifying paths for data files.
>>
>> best,
>> -Johnny
>>
>>
>> -------------------------------------------
>> Johnny Lin
>> CIRES, University of Colorado
>> Work Phone: (303) 735-1636
>> Web: http://cires.colorado.edu/~johnny/
>> -------------------------------------------
>>
Re: how to set path? [message #25321 is a reply to message #25177] Sat, 26 May 2001 10:33 Go to previous message
deja_jlin is currently offline  deja_jlin
Messages: 12
Registered: February 2001
Junior Member
"web" <jiali3@21cn.com> wrote in message news:<9eml0t$p6v$1@mail.cn99.com>...
> Sometimes, When I donot set full path, it can work. But sometimes it cannot.
> Why?
>
>
sorry, don't know why sometimes a partial path would work :(

best,
-Johnny


-------------------------------------------
Johnny Lin
CIRES, University of Colorado
Work Phone: (303) 735-1636
Web: http://cires.colorado.edu/~johnny/
-------------------------------------------
Re: how to set path? [message #25322 is a reply to message #25181] Sat, 26 May 2001 10:29 Go to previous message
deja_jlin is currently offline  deja_jlin
Messages: 12
Registered: February 2001
Junior Member
davidf@dfanning.com (David Fanning) wrote in message news:
> Johnny Lin (deja_jlin@my-deja.com) writes:
>
>> maybe someone else has help on specifying paths for data files.
>
> FILEPATH has always worked well for me. :-)
>
> Cheers,
>
> David

:) thanks! i guess i best learn new things when i
try to give advice :)

best,
-Johnny


-------------------------------------------
Johnny Lin
CIRES, University of Colorado
Work Phone: (303) 735-1636
Web: http://cires.colorado.edu/~johnny/
-------------------------------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: found it, sorry :)
Next Topic: Re: SPAWN command bug

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

Current Time: Wed Oct 08 15:28:26 PDT 2025

Total time taken to generate the page: 0.00662 seconds