Re: current-umask hga@xxxxxx 29 Apr 2020 13:14 UTC

> From: Lassi Kortela <xxxxxx@lassi.io>
> Date: Wednesday, April 29, 2020 4:43 AM
>
>> current-directory is also used by Gauche, with a comment that says
>> "... is found in ChezScheme, MzScheme, etc."
>
> Great! That should settle it. So e.g.:
>
> * current-directory (per-thread parameter)
> * os-current-directory (procedure - 0 args = getter, 1 arg = setter)
>
> * current-umask (per-thread parameter)
> * os-[current-]umask (procedure - 0 args = getter, 1 arg = setter)

This works for me, but while using argument count would keep the
number of procedures the same, we're already using "set-*" as a convention
for changing state.

I don't see see any need to include "current" in the umask procedure
names, current is implied, pretty much implied for all procedures like
this.  I'm not sure about changing working-directory to
current-directory, the underlying POSIX procedure wide call getcwd
uses both....  Using both could be better, but if not that, I'd prefer
keeping working-directory.

> IMHO "umask" is a bit cryptic and not applicable outside Unix. Could it
> be "unix-mask" instead, or simply "file-mask", "file-mode-mask",
> "file-permission-mask" or something? What's the equivalent on Windows?

Well, this is a *POSIX* API, and as you noted in other emails, there's
no real mapping of POSIX's very simple permissions bits model to Windows.

Plus we'd expect some number of users of this API to already know
"umask", and I don't think the u mapps to UNIX.  The meaning of the
bits is also inverted compared to the masks in file-info:mode and
set-file-mode, a 1 in the umask means "no you can't" create a file
with that bit, a 1 in the modes means "yes I am" set.

- Harold