Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Unix file permissions bug?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-06-08 (21:33)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] Unix file permissions bug?
On Sun, Jun 08, 2003 at 05:10:27PM -0400, wrote:

> >   # Unix.chmod "test1" 755;;
> This is 755 *decimal*.
> It looks like you meant 
> Unix.chmod "test1" 0o755;;

Ah ... quite so.

On Sun, Jun 08, 2003 at 11:15:32PM +0200, Nicolas George wrote:
> Le decadi 20 prairial, an CCXI, Matt Gushee a écrit?:
> >   # Unix.chmod "test1" 755;;
> Unix file permissions are bit fields.

I knew that, of course, but hadn't given it much thought.

> If you want to yuse the easy
> habitual notation, you need to use octal, not decimal: try 0o755.

Hmm ... would it be unreasonable to request that this be noted in the
Unix module docs? Maybe I shouldn't take for granted that a Unix API
spells things the same as a shell, but that seems most intuitive for
people like me who have never done systems programming.

There's nothing difficult about using the octal notation, of course.
It's just unexpected, and surely I'm not the only one who wouldn't have
expected it.

Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through           its fields;   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                            --Lao Tzu (Peter Merel, trans.)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: