[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to set path?
"web" <jiali3@21cn.com> wrote:
> Thank you.
> All the other files are in the same directory with sav file. How to get the
> path? I try to use
> path=FILEPATH('test.pro'), to get the full path,
> but failed. Are there any some function to do this?
I use the following code to determine the location of a .sav file
(courtesy of a source within RSI):
HELP, CALLS = calls
thisroutine = (STRSPLIT(calls[0], ' ', /EXTRACT))[0]
source = ROUTINE_INFO(thisroutine, /SOURCE)
CASE STRUPCASE(!version.os_family) of
'WINDOWS' : dirsep = '\'
'UNIX' : dirsep = '/'
'MACOS' : dirsep = ':'
'VMS' : dirsep = ']'
ELSE : dirsep = ''
ENDCASE
path = STRMID(source.path, 0, STRPOS(source.path, dirsep, /REVERSE_SEARCH))
Dave
--------------
Dave Greenwood Email: Greenwoodde@ORNL.GOV
Oak Ridge National Lab %STD-W-DISCLAIMER, I only speak for myself