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

Home » Public Forums » archive » A problem with pickfile?
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: A problem with pickfile? [message #6389 is a reply to message #6330] Tue, 18 June 1996 00:00 Go to previous messageGo to previous message
Tim Patterson is currently offline  Tim Patterson
Messages: 65
Registered: October 1995
Member
Julien Flack wrote:

> I had a little routine to do exactly the above (check for '/' or
> a '\' in the filename string). However, notice that under Motif
> it is possible to get a return filename something like: 'temp/'.
> Therefore, to find out if the returned file contains the path
> you must search for a separtor and make sure that the position
> of the separator is not equal to strlen()-1.
>
> I agree, this inconsistency, although not unsurmountable,
> is a little messy. It would be better if the convention was that
> the returned filename never included the path.
>
> --
> Julien.

Unfortunately, if you want to be platform independent, you also
need to check for VMS type directory structure too.

In the end, I used an idea that Phil Willams sent me to strip
out the path name if it existed in an OS independent way:

file = pickfile(get_path = path)
if strpos(file, path) eq 0 then $
file = strmid(file,strlen(path),strlen(file))

However, I put this into the PICKFILE.PRO code so that it
always returns just the file name, and I have to use the
GET_PATH if I need to know the directory path.

I would have liked to fix the widget so that it only copies the
file name into the text widget when selected from the file list,
but the code appeared to be built-in rather than a library
routine.

Tim
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: overplot using polyfill
Next Topic: how to delete all variables in IDL?

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

Current Time: Thu Oct 09 19:30:46 PDT 2025

Total time taken to generate the page: 1.36100 seconds