Writing To Binary File

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

Hey guys,

I'm confused as how I write to a binary file, is it the same as you would to a text file or is it different? Also, how would I do under a windows program using the win32lib?

integer fn 
integer data 
data = 0 
fn = open("sav.dat","wb") 
 
if fn = -1 then 
    puts(1,"Cannot write file!\n") 
  else 
      print(fn,data)  
end if 

Or would it be like this?

integer fn 
integer data 
data = 0 
fn = open("sav.dat","wb") 
 
if fn = -1 then 
    puts(1,"Cannot write file!\n") 
   else 
       wPrint(fn,data) 
end if 

Any help, please

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

Search



Quick Links

User menu

Not signed in.

Misc Menu