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

Home » Public Forums » archive » Re: The usage of PS_END
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: The usage of PS_END [message #62788 is a reply to message #62784] Mon, 06 October 2008 05:41 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
jlglover@gmail.com writes:

> While we are discusing these programs, I might ask the filename
> keyword works paths. If I call ps_start like this:
>
> ps_start,filename='plot.ps'
>
> the plot will sometimes appear in the directory of the program that
> calls ps_start and sometimes it appears in my home directory.
> Sometimes it even appears in the directory that stores ps_start.pro.
> Does anyone (David perhaps) have any advice about how to control where
> the output of ps_start appears? I am using IDL 7.0 on a Mac.

As a matter of fact, I do know something about this.
It appears to me, although I haven't confirmed this theory,
that there is a difference in how IDL 7 handles file names.
It used to be, for example, that in most of IDL's file name
machinery, you could use forward or backward slashes
interchangeably.

And while this appears still to be true for *some* of the
IDL routines, it is clearly *NOT* true for Dialog_Pickfile.
On Windows machines, at least, if you set the opening path with
forward slashes, Dialog_Pickfile ignores the PATH variable and
opens the file in the directory that was *last* opened in that
IDL session.

I found this out because I was starting to be confused by
PSConfig, too. So, this past weekend I looked into it, and
I traced the problem to FSC_FileSelect, which is what I use
to select files in PSConfig. FSC_FileSelect was routinely
changing back slashes to forward slashes whenever it had
to work with directory names, which was fairly often. I am
not sure now exactly *why* I thought that was a good idea
all those years ago when I wrote that program, but it is clearly
not a good idea now, so I have stripped all that code out of
the program. (Actually, I just commented it out, because
clearly I meant to do it for some reason, and absent the
reason, I am reluctant to commit 100 percent in the opposite
direction.)

It now appears to work consistently, as long as the user
specifies the directory name in a way that is consistent with
good practice for that particular operating system. However,
if the path is incorrect (maybe you have misspelled the
directory name), then Windows still uses the last opened
directory in Dialog_Pickfile.

So, if I were you, I think I would download a new copy of the
Coyote Library. I think I would do this anyway, since I have
made at least 20-30 changes to the library in the past couple
of weeks, including numerous changes to PSConfig. You can find
it here:

http://www.dfanning.com/programs/coyoteprograms.zip

I would encourage everyone to do this whose library is older
than, say, yesterday. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Debugging C code called from CALL_EXTERNAL
Next Topic: Re: Debugging C code called from CALL_EXTERNAL

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

Current Time: Sat Oct 11 09:34:09 PDT 2025

Total time taken to generate the page: 1.27901 seconds