[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Writing binary data
- From: "Stockdale, Daire, SOE" <stockdaled@...>
- Date: Thu, 11 May 2006 11:21:02 +0100
Hello
Is there any way to write to file the binary representation of a
lua_Number without using a custom module? I'd like the following to
work:
local myNumbers = { 0.0, 1.0, 2.0, 3.0, 4.0 }
local myFile = assert( io.open( "myFile.dat", "wb" ) )
for i=1, #myNumbers do
-- Write myNumbers[i] to file here as binary,
-- as if in C we had called
-- fwrite( &myNumbers[i], sizeof(myNumbers[i]), 1, myFile )
end
Thanks,
Daire
========================================
DISCLAIMER
The contents of this e-mail and any attachments are confidential to the intended recipient and may also be legally privileged. Unless you are the named addressee (or authorised to receive for the addressee) of this email you may not copy, disclose or distribute it to anyone else.
If you have received this email in error, please notify us immediately by e-mail on administrator@sega.co.uk and then delete the email and any copies. The SEGA Group have made all reasonable efforts to ensure that this e-mail and any attached documents or software are free from software viruses, but it is the recipient's responsibility to confirm this.
========================================