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 VAA02694; Fri, 23 Apr 2004 21:14:53 +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 VAA02402 for ; Fri, 23 Apr 2004 21:14:52 +0200 (MET DST) Received: from mz2.forethought.net (mzpi4.forethought.net [216.241.36.13]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3NJEojq014537 for ; Fri, 23 Apr 2004 21:14:51 +0200 Received: from [216.241.35.41] (helo=swordfish) by mz2.forethought.net with esmtp (Exim 4.30) id 1BH68P-0002JJ-L3 for caml-list@inria.fr; Fri, 23 Apr 2004 13:14:49 -0600 Received: from matt by swordfish with local (Exim 3.35 #1 (Debian)) id 1BH68P-0005xx-00 for ; Fri, 23 Apr 2004 13:14:49 -0600 Date: Fri, 23 Apr 2004 13:14:49 -0600 From: Matt Gushee To: caml-list@inria.fr Subject: Re: [Caml-list] Unix.chmod => what codes for what mode?! Message-ID: <20040423191449.GA9194@swordfish> Reply-To: Matt Gushee Mail-Followup-To: caml-list@inria.fr References: <20040423171634.GA887@first.in-berlin.de> <20040423180102.GA24360@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040423180102.GA24360@redhat.com> User-Agent: Mutt/1.3.27i X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; gushee:01 mgushee:01 havenrock:01 caml-list:01 chmod:01 2004:99 2004:99 oliver:01 bandel:01 chmod:01 permissions:01 permissions:01 755:99 755:99 someplace:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Apr 23, 2004 at 07:01:02PM +0100, Richard Jones wrote: > On Fri, Apr 23, 2004 at 07:16:34PM +0200, Oliver Bandel wrote: > > > > The Unix.chmod function is bad documented. I agree. See below. > Almost certainly you're not using octal numbers right. The format > for octal numbers in OCaml is different from C, for example: My guess would be that he simply wasn't conscious of the fact that they *were* octal numbers--which is the same mistake I made at first and have seen several others make. The fact that permissions are octal is easy to understand, but--if you have worked with file permissions in the Unix shell and never either worked with them in a medium level language like C or thought deeply about what the numbers represent, it's not at all obvious. After all, in the following: > % chmod 755 filename 755 just looks like an integer, doesn't it? Hence the documentation issue. I also suggested, when I ran into this problem, that the fact these are octal numbers should be documented. I was told that it is documented, in ... I forget where, but someplace rather distant from the Unix API doc. I submit that that is inadequate documentation for many people. Of course, it's often very difficult to tell how thoroughly and explicitly to document a language. And the very best programmers, and those most familiar with the system, often produce documentation that is both thorough and correct, but at the same time horribly obscure for mere mortals. Actually, I think the OCaml team does pretty well, considering the inherent difficulty of the language and the small amount of time they can devote to documentation. Still, it could be better. It often seems that, when people raise concerns like this about the OCaml documentation, they get responses that, while well-intentioned and courteous, imply that it is their fault for not having read the right document or for lacking the necessary background (BTW, I'm not pointing at anyone in this particular discussion), and that's a shame. I'm reminded of the old parables of Jesus (or the Buddha) knocking on people's doors disguised as a beggar: the "dummy" you alienate with an unhelpful answer might turn out to have been a high school student who could have become a brilliant OCaml programmer, or perhaps a senior system architect who no longer programs very much--but might be in a position to influence the CTO of a large corporation. Not that we should try to make OCaml understandable to the entire world--that would be absurd. But when a small effort would make it easier for a significant number of people, why not? E.g.: Note that [permissions] is an octal number. Example: Unix.chmod 0o755 myfile There. That took about 30 seconds. -- 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