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 IAA20891; Tue, 7 Aug 2001 08:34:17 +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 IAA20894 for ; Tue, 7 Aug 2001 08:34:07 +0200 (MET DST) Received: from maties1.sun.ac.za (maties1.sun.ac.za [146.232.128.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f776Y4926487 for ; Tue, 7 Aug 2001 08:34:05 +0200 (MET DST) Received: from bywoner.sun.ac.za ([146.232.129.121]) by maties1.sun.ac.za with esmtp (Exim 3.31 #1) id 15U0RB-0007UC-00 for caml-list@inria.fr; Tue, 07 Aug 2001 08:33:57 +0200 Received: from js by bywoner.sun.ac.za with local (Exim 3.22 #1 (Debian)) id 15U2JI-0007fG-00 for ; Tue, 07 Aug 2001 08:33:56 +0000 To: ocaml mailing list Subject: Re: [Caml-list] using open_out_gen, output_string and close_out From: Johann Spies Date: 07 Aug 2001 08:33:56 +0000 Message-ID: <87snf41d6z.fsf@#maties.sun.ac.za> User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Jeremy Fincher" writes: > I believe your permissions are wrong. I can't tell you what > algorithm to use to determine the permissions number, but I know it > has to include some bits for the file type (plain file, socket, > pipe, directory, etc.) > > When I want 0644 I use 33188. That's all I can tell you. I found > that number by looking at the ST_MODE return value of the stat(2) > call on a regular file that i knew was 0644 :) I think the following illustrates that the permissions is are not the problem: # let l = open_out_gen [Open_creat; Open_append] 33188 "/tmp/xx";; val l : out_channel = # let skryf = output_string l "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccc";; val skryf : unit = () # close_out l;; Uncaught exception: Sys_error "Bad file descriptor". # -rw-r--r-- 1 js js 0 Aug 7 08:27 xx # let k = open_out_gen [Open_creat; Open_append] 0o644 "/tmp/yy";; val k : out_channel = # output_string k "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccc";; - : unit = () # close_out k;; Uncaught exception: Sys_error "Bad file descriptor". -rw-r--r-- 1 js js 0 Aug 7 08:29 yy Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch "If ye be reproached for the name of Christ, happy are ye; for the spirit of glory and of God resteth upon you; on their part He is spoken evil of, but on your part He is glorified." I Peter 4:14 ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr