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

Home » Public Forums » archive » Re: How to get the current working directory
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: How to get the current working directory [message #70101] Thu, 11 March 2010 14:21 Go to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
On 11 Mrz., 11:35, "abe...@gmail.com" <abe...@gmail.com> wrote:
> In IDL command line, if I type
>
> CD, C=c & PRINT, c
>
> I get
>
> /home/bert_an
>
> Say I have a routine main.pro under /home/bert_an/MyCode
> so the complete path is /home/bert_an/MyCode/main.pro
>
> Is there a function that while running main.pro gives me the path to
> this file?
> Example:
>
> IDL> print, PathFunction
> /home/bert_an/MyCode
>
> Thank you,
> Andrés

Maybe this works:

Help, Calls=callStack
thispath = strmid(((str=strmid(((c=callstack[0])),((start=strpos(c,'<')
+1)),$
strpos(c,'(')-start))),0,strpos(str,FILE_basename $
(strmid(c,((start=strpos(c,'<')
+1)),strpos(c,'(')-start))))

Cheers,

CR
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: HDF5 crash on macOS
Next Topic: idl program for calling c program

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

Current Time: Thu Oct 09 04:33:20 PDT 2025

Total time taken to generate the page: 0.24301 seconds