[plt-scheme] How to set file permissions (chmod) for linux/OSX?
On May 16, Barland, Ian wrote:
> Hi --
> How do I do a `chmod` from within mzscheme, for programs running on
> OSX?
There's no way to change the permissions (yet?).
> (If I need to make an ffi call to 'system', any hints on exactly
> which lib-ffi I need to load?)
That's easy:
#lang scheme
(require (lib "foreign.ss")) (unsafe!)
(define chmod (get-ffi-obj "chmod" #f (_fun _path _int -> _void)))
(chmod "some-path" #o644)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!