[racket] Unix file permissions/owner/group

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Mon Aug 30 04:50:16 EDT 2010

Has anyone already implemented Racket API for dealing with Unix file 
permissions/owner/group?

Some things I have needed sometimes:

* Procedure(s) to set a named file's permissions, owner, and/or group.

* Procedure to get the permissions, owner, and group of a named file.

Also handy would be:

* The standard "open-output-file", "call-with-output-file", etc., have 
keyword argument to specify the desired permissions when/if creating the 
file.  (Unfortunately, this can't be implemented as well in a PLaneT 
package as it can in the Racket core.)

The permissions bits could be represented in the API as a number, on 
which users do bitwise arithmetic.

For API representation of the owner and group, I'm not sure whether 
numbers, strings, or ADTs should be preferred.  For casual applications 
programming, I usually want strings; for systems programming, I usually 
want the actual UID and GID.  Maybe when setting, we can provide a 
number or string, and when getting we receive a number (with separate 
procedures available to map the numbers to the strings).

I would be willing to implement this, but I don't want to be redundant 
with anything anyone else has done or is planning.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.