Re: Saving sequences
- Posted by doncole2009 Jul 02, 2009
- 1060 views
This is what I use to load and save binary files.
It could be a complicated sequence,text or anything.
include bget.e ------------------the binary way -------------------- global function get_file(sequence file_name)--binary file integer fn object database fn=exist(file_name) if fn=0 then --does not exist fn=open(file_name,"wb") end if fn = open(file_name, "rb") if fn=-1 then puts(1,"Can't open file:"& file_name) end if database = bget(fn) close(fn) if length(database)<2 then return {} else return database[2] end if end function global procedure save_file(sequence db,sequence file_name) integer fn fn = open(file_name, "wb") bprint(fn,db) close(fn) end procedure Don Cole