[racket] Setting umask from within Racket

From: Mello, Cody (cody at cs.brown.edu)
Date: Sun Sep 14 03:10:00 EDT 2014

Hello everyone,

Is there a way to set the umask of the process from within Racket? Or to
specify the mode of a newly created file? I've been looking through the
documentation, but I'm not finding anything along these lines. I was hoping
that I could do something like the following from within my program:

(parameterize ([umask #o007])
  (display-to-file 5 "test-file"))

Or like this:

(display-to-file 5 "test-file" #:perms #o660)

I could change the permissions of the file with
file-or-directory-permissions after creating the file, but what I really
want to do is create the file with those permissions from the start. Is
there a good way to accomplish this? Am I missing something in the
documentation?

Thanks!

- Cody
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140914/75786421/attachment.html>

Posted on the users mailing list.