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

Home » Public Forums » archive » FILE_EXPAND_PATH
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: file_expand_path [message #51860 is a reply to message #35617] Thu, 14 December 2006 16:36 Go to previous messageGo to previous message
damonanomad is currently offline  damonanomad
Messages: 2
Registered: December 2006
Junior Member
First off, thanks for the fast reply, David. I didn't get back to IDL
until today.

> if your current
> working directory is C:\somewhere, then when you
> execute the function you get this:
>
> IDL> Print, File_Expand_Path('foo.pro')
> C:\somewhere\foo.pro
>
> This is true whether foo.pro exists or not! (This
> is basically the way FILEPATH works, but perhaps the
> name of this function doesn't disappoint you with inflated
> expectations.)

This is a surprising result to me. It appears, then, that
File_expand_path is basically equivalent to "pwd" in linux, with the
exception that it tacks on a file name that may or may not be in that
current working directory. Strange.


> You will have to get into the directory where the file exists
> before you execute the command:
>
> IDL> CD, 'fieldinfo'
> IDL> Print, File_Expand_Path('full28field.table')
> C:\DocSet\MyDoc\IDL\working\FieldInfo\full28field.table
>

I guess that the short answer is that the file_expand_path function
will not do what I had hoped (give the path of a file in some "unknown"
sub-directory of my working directory). In looking at the online help
index some, I think that file_search may be more suited to what I am
trying to do. However, when I try to use it following one of their
examples (#6):

Result = FILE_SEARCH('$HOME', '*', /EXPAND_ENVIRONMENT,
/TEST_DIRECTORY)

Result has nothing in it although there are sub-directories and
sub-sub-directories in my working directory. Is '$HOME' not the
working directory in windows?

Damon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Zipped Files
Next Topic: Capturing a screenshot in IDL

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

Current Time: Fri Oct 10 02:36:30 PDT 2025

Total time taken to generate the page: 1.03946 seconds