I apologise if ?bug? is not proper nomenclature in this forum.
Consider the following program, stored as ?binio.sml? in the current directory:
structure FS = Posix.FileSys structure IO = Posix.IO
fun main () = let val fname = "binio.sml" val fd = FS.openf (fname, FS.O_RDONLY, (FS.O.flags [])) val rd = IO.mkBinReader {fd=fd, initBlkMode=false, name=fname} val stream = BinIO.mkInstream (BinIO.StreamIO.mkInstream (rd, Word8Vector.fromList [])) in print (Byte.bytesToString (BinIO.inputAll stream)) end
;
main()
On OS X 10.9.5 I get:
$ poly --use binio.sml Poly/ML 5.5.2 Release structure FS : POSIX_FILE_SYS structure IO : POSIX_IO val main = fn: unit -> unit Assertion failed: (save_vec_addr < save_vec+1000), function push, file save_vec.cpp, line 70. Abort trap: 6
BTW is there a simpler/more canonical way to take a Posix.FileSys.file_desc into a BinIO.instream? I copied the above pretty much verbatim from the Poly/ML sources.
thanks, peter
On 21/12/2014 00:01, Peter Gammie wrote:
I apologise if ?bug? is not proper nomenclature in this forum.
$ poly --use binio.sml Poly/ML 5.5.2 Release structure FS : POSIX_FILE_SYS structure IO : POSIX_IO val main = fn: unit -> unit Assertion failed: (save_vec_addr < save_vec+1000), function push, file save_vec.cpp, line 70. Abort trap: 6
I think that fully qualifies as a bug. Thanks for reporting it. It was a trivial error and I fixed it in SVN head. It probably deserves to be ported to the fixes branch.
BTW is there a simpler/more canonical way to take a Posix.FileSys.file_desc into a BinIO.instream? I copied the above pretty much verbatim from the Poly/ML sources.
I think this is the only way to do this.
David