From: Johann Spies <jspies@maties.sun.ac.za>
To: ocaml mailing list <caml-list@inria.fr>
Subject: Re: [Caml-list] using open_out_gen, output_string and close_out
Date: 07 Aug 2001 08:33:56 +0000 [thread overview]
Message-ID: <87snf41d6z.fsf@#maties.sun.ac.za> (raw)
"Jeremy Fincher" <tweedgeezer@hotmail.com> 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 = <abstr>
# 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 = <abstr>
# 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
next reply other threads:[~2001-08-07 6:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-07 8:33 Johann Spies [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-08-07 0:36 Jeremy Fincher
2001-08-06 20:37 Johann Spies
2001-08-07 7:36 ` Xavier Leroy
2001-08-07 10:46 ` Johann Spies
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='87snf41d6z.fsf@#maties.sun.ac.za' \
--to=jspies@maties.sun.ac.za \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox