Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_out_gen on SunOS #8464

Closed
vicuna opened this issue Jan 31, 2004 · 2 comments
Closed

open_out_gen on SunOS #8464

vicuna opened this issue Jan 31, 2004 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 31, 2004

Original bug ID: 2107
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: André Allavena
Version: Objective Caml native-code compiler, version 3.02
OS: SunOS 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire-280R
Submission from: dhcp97-237.cs.cornell.edu (128.84.97.237)

open_out_gen has issues ompiling with ocamlopt:

open_out_gen [Open_wronly; Open_creat; Open_append ] 0o644 fichier
works fine,
but
open_out_gen [Open_creat; Open_append ] 0o644 fichier
doesn't.
[The difference is in the Open_wronly flag]

Both compile fine. I get a
Fatal error: uncaught exception Sys_error("Bad file number")
at run time in the second case,when the Open_wronly is absent.
More precisely, the error arises when I actually try to write to the file
Printf.fprintf stat_file "%f\t%f\t%f\n" single_tmp double_tmp
triple_tmp;;
when I had earlier on
let stat_file = open_out_gen [Open_wronly; Open_creat; Open_append ] 0o644
fichier

Both versions work under Linux 3-07

@vicuna
Copy link
Author

vicuna commented Feb 14, 2004

Comment author: administrator

open_out_gen has issues ompiling with ocamlopt:

open_out_gen [Open_wronly; Open_creat; Open_append ] 0o644 fichier
works fine,
but
open_out_gen [Open_creat; Open_append ] 0o644 fichier
doesn't.
[The difference is in the Open_wronly flag]

Both compile fine. I get a
Fatal error: uncaught exception Sys_error("Bad file number")
at run time in the second case,when the Open_wronly is absent.

This is consistent with the POSIX API: opening for appending doesn't
imply opening for writing. Since this behavior is somewhat useless,
OCaml 3.06 and later silently add Open_wronly when only Open_append is
given.

Best regards,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Feb 14, 2004

Comment author: administrator

Not really a bug, but fixed since 3.05 anyway.

@vicuna vicuna closed this as completed Feb 14, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant