Re: file permission problem
[email protected] (Don Cohen)
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <[email protected]> |
> yet another in my series of inane problems -
> I'm trying to create files that are read/write by group (in linux).
> I've managed to get these things to work as desired:
>
> echo "hi" > /home/cmcadm/data2009/mb3
> =>
> -rw-rw----. 1 marilyn cmcadm 3 Aug 11 10:14 mb3
>
> touch ~cmcadm/data2009/mb
> =>
> -rw-rw----. 1 marilyn cmcadm 0 Aug 10 22:15 mb
>
> and yet in clisp ...
>
> [1]> (with-open-file (s "/home/cmcadm/data2009/mb2" :direction :output))
> NIL
> =>
> -rw-r-----. 1 marilyn cmcadm 0 Aug 11 10:13 mb2
>
> What am I missing?
Those are NOT Common Lisp notions.
File modes, user, group, other, etc are POSIX notions.
So how would you do in C?
As far as I can tell you'd set umask - but that's already done.
The question is why clisp acts differently from touch.
These are all done from the same login and same environment.
If you've found that you could use the process umask to configure the
default mask used when creating files, then you know what should ask
clisp about:
(apropos "UMASK" "POSIX")
(describe 'posix:umask)
which seems to only allow me to set it, not read it, btw
(run-shell-command "umask")
0006
just like
$ umask
0006
------------------------------------------------------------------------------
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list