You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4119 Reporter:@xavierleroy Assigned to:@pierreweis Status: closed (set by @xavierleroy on 2007-02-21T14:49:18Z) Resolution: fixed Priority: normal Severity: major Version: 3.10+dev Fixed in version: 3.10+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
(Reported on behalf of users at Athys.)
The following program dies with a Sys_error("Bad file descriptor") exception,
caused by reading from a closed in_channel.
------------- program --------------
open Printf
let _ =
let file = "toto" in
let scanbuf = Scanf.Scanning.from_file file in
let l = ref [] in
try
while not (Scanf.Scanning.end_of_input scanbuf) do
l := (Scanf.bscanf scanbuf " %S -> %S ; " (fun c d -> c,d))::!l
done
with
| Scanf.Scan_failure s -> failwith (sprintf "in file %s, %s" file s)
| End_of_file -> failwith (sprintf "in file %s, unexpected end of file" file)
---- input data file ./toto ----
"foo" -> "bar";
The text was updated successfully, but these errors were encountered:
Original bug ID: 4119
Reporter: @xavierleroy
Assigned to: @pierreweis
Status: closed (set by @xavierleroy on 2007-02-21T14:49:18Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10+dev
Fixed in version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
(Reported on behalf of users at Athys.)
The following program dies with a Sys_error("Bad file descriptor") exception,
caused by reading from a closed in_channel.
------------- program --------------
open Printf
let _ =
let file = "toto" in
let scanbuf = Scanf.Scanning.from_file file in
let l = ref [] in
try
while not (Scanf.Scanning.end_of_input scanbuf) do
l := (Scanf.bscanf scanbuf " %S -> %S ; " (fun c d -> c,d))::!l
done
with
| Scanf.Scan_failure s -> failwith (sprintf "in file %s, %s" file s)
| End_of_file -> failwith (sprintf "in file %s, unexpected end of file" file)
---- input data file ./toto ----
"foo" -> "bar";
The text was updated successfully, but these errors were encountered: