|
From: David T. L. <le...@ma...> - 2002-09-06 14:31:16
|
On Fri, Sep 06, 2002 at 12:04:59PM +0200, Bert Freudenberg wrote:
> On Fri, 6 Sep 2002, Andreas Raab wrote:
>
> > That wasn't the problem. What I needed was knowing from within the
> > *image* what the CWD is. E.g., FileDirectory takes the "default
> > directory" from the image name (and I am not inclined to change this)
> > but this means you cannot find out where something like a log file goes.
>
> I'm pretty sure OSProcess allows you to query the CWD. It's rather
> platform-dependent, isn't it?
Well, it *should* be rather platform independent. On a Unix platform,
ThisOSProcess>>getCwd answers the result of getcwd(), which is as described
by Ian earlier in this thread. On any other platform, it answers the result
of "FileDirectory default pathName", which would match the current
Windows behavior.
I agree with keeping the Unix VM behavior as is (a "-cwd" flag would not
add anything useful).
On Windows, the image directory is the sensible default location for log
files, but I expect that it would be possible to pick up the "Start in:"
path (as displayed in the properties dialog of a desktop icon for running
Squeak). Presumably that's what you get from a Win32 call to
GetCurrentDirectory(), right? If so, this would follow the same behavior
as the Unix implementation, which would in most cases end up being the
image directory anyhow. If the user wanted the log files to go somewhere
else, s/he would set the "Start in:" path to the location for the log files,
and specify an explicit path the the image on the command line ("Target:"
in the properties dialog).
Hmm, I guess I had better go add the correct #getCwd support for Win32
into OSProcess, now that I think about it.
Dave
|