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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to get the current working directory [message #70101] Thu, 11 March 2010 14:21
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
Re: How to get the current working directory [message #70109 is a reply to message #70101] Thu, 11 March 2010 06:36 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
aberte@gmail.com schrieb:
> 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

Hi


result=get_profile_path()

http://www.fz-juelich.de/icg/icg-1/idl_icglib/idl_source/idl _html/dbase/get_profile_path_dbase.pro.html

cheers
Reimar
Re: How to get the current working directory [message #70110 is a reply to message #70109] Thu, 11 March 2010 04:12 Go to previous message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Thu, 11 Mar 2010 02:35:00 -0800 (PST), "aberte@gmail.com"
<aberte@gmail.com> wrote:

> Is there a function that while running main.pro gives me the path to
> this file?

http://www.dfanning.com/programs/programrootdir.pro
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 13:43:06 PDT 2025

Total time taken to generate the page: 0.00739 seconds