1. Re: New Project Problems

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

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu