Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] slight difference of behavior of OCaml on MinGw and Linux
@ 2011-03-28  7:32 Yoriyuki Yamagata
  2011-03-28  8:13 ` David Allsopp
  0 siblings, 1 reply; 2+ messages in thread
From: Yoriyuki Yamagata @ 2011-03-28  7:32 UTC (permalink / raw)
  To: Caml List


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

Hi, list.

I think I found a slight difference of behavior of OCaml on MinGW and Linux
regarding the EOF character.  On Linux, the EOF char in the middle of a file
is ignored, but on MinGW, the attempt to read EOF causes End_of_file
Exception.  Is this a supposed behavior?

(ok, I have found some discussion on EOF on beginners list, but cannot find
something exactly answering this problem.)

I attached an ocaml program (which is simply a cat) and a file which
reproduce the problem.  On Linux, doing
ocaml testEoF.ml < UTF-32#LE
outputs the whole file before the exception End_of_file, but on MinGW, the
script fails in the middle of Etruscan text, which happens to contain 0x1a
character.

Best,

-- 
Yoriyuki Yamagata
yoriyuki.y@gmail.com
http://sites.google.com/site/yoriyukiy/<https://sites.google.com/site/yoriyukiy/>

[-- Attachment #1.2: Type: text/html, Size: 998 bytes --]

[-- Attachment #2: testEoF.ml --]
[-- Type: application/octet-stream, Size: 62 bytes --]

while true do
  output_char stdout (input_char stdin)
done

[-- Attachment #3: UTF-32#LE --]
[-- Type: application/octet-stream, Size: 1068 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-28  8:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-28  7:32 [Caml-list] slight difference of behavior of OCaml on MinGw and Linux Yoriyuki Yamagata
2011-03-28  8:13 ` David Allsopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox