From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA03077; Sun, 8 Jun 2003 23:33:46 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA02945 for ; Sun, 8 Jun 2003 23:33:44 +0200 (MET DST) Received: from swordfish ([216.241.35.41]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h58LXhT21086 for ; Sun, 8 Jun 2003 23:33:43 +0200 (MET DST) Received: from matt by swordfish with local (Exim 3.35 #1 (Debian)) id 19P7nL-0001jq-00 for ; Sun, 08 Jun 2003 15:33:43 -0600 Date: Sun, 8 Jun 2003 15:33:43 -0600 From: Matt Gushee To: caml-list@inria.fr Subject: Re: [Caml-list] Unix file permissions bug? Message-ID: <20030608213343.GB5804@swordfish> Reply-To: Matt Gushee Mail-Followup-To: caml-list@inria.fr References: <20030608210121.GA5804@swordfish> <20030608211532.GA9786@clipper.ens.fr> <20030608210121.GA5804@swordfish> <16099.42563.310382.510961@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20030608211532.GA9786@clipper.ens.fr> <16099.42563.310382.510961@gargle.gargle.HOWL> User-Agent: Mutt/1.3.27i X-Spam: no; 0.00; gushee:01 mgushee:01 havenrock:01 caml-list:01 permissions:01 bug:01 0400,:01 chmod:01 755:99 habitual:99 api:01 spells:99 unexpected:01 englewood:01 manure:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, Jun 08, 2003 at 05:10:27PM -0400, john.chu@sun.com 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 mgushee@havenrock.com its fields; http://www.havenrock.com/ When a nation ignores the Way, Horses bear soldiers through its streets. --Lao Tzu (Peter Merel, trans.) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners