[PYTHONMAC-SIG] chdir() and Standard File
Just van Rossum
just@knoware.nl
Mon, 15 Jul 1996 00:53:48 +0200
Jack,
At 11:55 PM 7/14/96, Jack Jansen wrote:
>Currently, the Standard File working directory and the "other" working
>directory (i.e. what you set with os.chdir() and what relative paths
>are relative to) are completely separated. This has the advantage that
>python programs have a "MacOS feel", i.e. the initial
>macfs.StandardGetFile dialog will come up in the place people expect
>from other mac programs. On the other hand it feels strange to Python:
>you chdir() somewhere and ask the user for a file, but it comes up in
>a different folder from where you just chdir'd to.
>
>Possibilities:
>- keep it as it is (chdir and Standard File completely uncoupled)
No! (err, yes but...)
>- make them tightly coupled (chdir immedeately changes Standard File
> folder)
No! Either way it will confuse users.
>- make them optionally coupled (setting "macfs.followchdir" to one
> makes Standard File follow chdir)
Hmm... nah.
>- create macfs.chdir() which would set Standard File working
> directory.
Yes! That way it will be easy to implement this: when you choose "Save
As..." you automatically get to the folder where the original file lives. I
hate it when apps send you to the apps' home folder when you choose "Save
As..." after doubleclicking a document... And you'd be independent of
os.chdir(), which might be used for other reasons (like if you import
modules that live in the same directory as __main__ and that directory is
not in the Python search path).
It should be clearly documented to avoid confusion.
(but I guess you knew my point of view somehow...)
Just
=================
PYTHONMAC-SIG - SIG on Python for the Apple Macintosh
send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
=================