RE: [Haskell-cafe] setPermissions bug?

I've run into a problem using Directory.setPermissions (or equivalently System.Directory.setPermissions).
Basically the problem is that
getPermissions f >>= setPermissions f
is not a noop. Instead it is equivalent to
chmod o-r f chmod g-r f etc
I presume that this is a bug in setPermissions?
Yes, it's a bug. However, since getPermissions/setPermissions doesn't really give you enough control in Unix, I suggest you use the functions available from System.Posix instead (fileStatus, fileMode, setFileMode etc.). Cheers, Simon

On Wed, Feb 18, 2004 at 12:31:34PM -0000, Simon Marlow wrote:
I presume that this is a bug in setPermissions?
Yes, it's a bug. However, since getPermissions/setPermissions doesn't really give you enough control in Unix, I suggest you use the functions available from System.Posix instead (fileStatus, fileMode, setFileMode etc.).
Well, in my case all I want to do is to copy permissions from one file to another, so get/setPermissions would have been fine. But yeah, I've already switched to using setFileMode etc. -- David Roundy http://www.abridgegame.org
participants (2)
-
David Roundy
-
Simon Marlow