1. Re: New Project Problems
- Posted by Jeffrey Fielding <JJProg at CYBERBURY.NET> Oct 01, 1998
- 449 views
If you want to read a file REALLY, REALLY fast, you can use doswrap.e: function readFile(sequence fileName) atom mem integer f, n sequence r f =3D DosOpen(fileName,0) 0 -- Open for read if f =3D -1 then return -1 end if mem =3D allocate_low(512) if mem < 1 then -- Couldn't allocate 512 bytes return -1 end if r =3D {} n =3D BlockRead(f,mem,512) -- Read first 512 bytes while n > 0 do r =3D r & peek({mem,n}) -- Get the bytes from memory n =3D BlockRead(f,mem,512) -- Read next 512 bytes end while f =3D DosClose(f) return r end function