1. CODE : Bload

Untested solutions to the added byte...

function bload(sequence path)
integer fn,c
sequence r

        r={}
        fn=open(path,"rb")
        c=fn
        while c!=-1 do
                c=getc(fn)
                r=r&c
        end while
        if length(r) then
                r=r[1..length(r)-1]
        end if
        return r
end function

or...

function bload(sequence path)
integer fn,c
sequence r

        fn=open(path,"rb")
        if fn != -1 then
                while 1 do
                        c=getc(fn)
                        if c = -1 then
                                exit
                        end if
                        r=r&c
                end while
        end if
        return r
end function

or...

function bsave(sequence path, sequence cont)
integer fn,c

        r={-1}
        fn=open(path,"wb")
        if fn != -1 then
                puts(fn, cont[1..length(cont)-1]
        end if
        return r
end function

-----
Sincerely,
Mathew Hounsell
Mat.Hounsell at Mailexcite.Com




Free web-based email, Forever, From anywhere!
http://www.mailexcite.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu