file permissions and copying files

Henning Thielemann lemming at
Sun Feb 22 18:46:50 EST 2009

On Fri, 20 Feb 2009, Duncan Coutts wrote:

> I have complained before about the System.Directory file permissions
> API, and how it relates to copyFile.
> Let me give an example of where the existing copyFile API is too
> limited. Perhaps this will help us think about what an improved API
> might be.
> ...
> So for Unix the mapping is:
> setUserReadable True/False     chmod u+r / u-r
> setUserWritable True/False     chmod u+w / u-w
> setOtherReadable True/False    chmod go+r / go-r
> setOtherWritable True/False    chmod go+w / go-w

It's not hard to predict that 'Other' will be too coarse for some 
applications, although I haven't an example. However, maybe we should have 
a new package which provides common functions for Unix and Windows as 
needed by Cabal. I expect that the 3 cases of permission transfer that you 
described for Cabal will also occur in other applications. From this 
package a general API for System.Directory may evolve.

More information about the Libraries mailing list