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

Home » Public Forums » archive » cd bug in IDL 5.5
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: cd bug in IDL 5.5 [message #31087 is a reply to message #31068] Tue, 18 June 2002 00:02 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Ben wrote:
>
>> another, perhaps, bug i have discovered is that the file_expand_path
>> expands from the current working directory (not very handy :x ), not the
>> actual directory where the file might be. It should issue a warning if that
>> file does not exist in the current directory, something like:
>
> I too have noticed that file_expand_path doesn't work the way you
> would hope
> it would. As a solution I wrote my own "search" program that looks for
> a file
> and returns the full path to it. It will look outside of the working
> directory. It returns an array of all paths fitting 'filename'. It's
> probably not perfect but it works.
>
> Hope this helps,
>
> Ben Hilldore
> Hope College Nuclear Research Group
>
> function getFilePath, filename
> dirs = expand_path('+c:\', /all_dirs, /array)
> filenames = strarr(n_elements(dirs))
> for i = 0,n_elements(dirs)-1 do begin
> filenames[i] = findfile(dirs[i] + '\' + filename)
> endfor
> return, filenames[where(strlen(filenames) gt 1)]
> end


Dear Ben,

it could be easier to use file_which

x=file_which('mean.pro')
print,x
/usr/local/idl/idl/lib/mean.pro

fpe=file_path_name_ext(x)

print,fpe.path
/usr/local/idl/idl/lib/


http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/file_path_name_ext.tar.gz

For further routines and licensing please have a look at
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html

regards

Reimar
--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Format codes in IDL
Next Topic: RSI Announces HDF5 Support -- Free IDL 5.5 Plug-in Available

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

Current Time: Thu Dec 04 00:39:37 PST 2025

Total time taken to generate the page: 0.34731 seconds