Re: get() gets() etc...

new topic     » goto parent     » topic index » view thread      » older message » newer message

>In BASIC there is a LOF() function which returns the length of the file and a

(assumes file fn opened as binary)
integer junk,LOF
junk=seek(fn,-1)
LOF=where(fn)

>BLOAD which lets you quickly load a whole file or a large part into memory
>(starting at the beginning, unfortunately).  I have no idea if Euphoria
>supports this, but it would seem pretty necessary if we want any kind of
>speed.

function bload(sequence path)
    integer fn,c
    sequence r
    r={}
    fn=open(path,"rb")
    c=getc(fn)
    while c!=-1 do
        r=r&c
        c=getc(fn)
    end while
    return r
end function

----------------------------------------------------

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu