Re: how to write on disk
Re: how to write on disk
- Subject: Re: how to write on disk
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 4 Mar 2008 16:15:11 +0100
Le 4 mars 08 à 15:50, norio a écrit :
Hi,
I think I understand how to write data on a disk using archive and
serialization mechanism, but how about this case?
I just want to write a short value, a long value and a double value
in this order. I don't want to write anything but them.
And I'd like to use document-based application to write the data
onto a disk.
Any suggestions would be welcomed.
Thank you,
Norio Ota
Create an NSMutableData Object. Append your value using -
appendBytes:length:
Use -writeToFile:options:error: to save your data.
Do not forget to swap yout bytes if needed.
If you want to append a short using Big Endian order, you can do
something like this:
short myshort = 4124;
myshort = OSSwapHostToBigInt16(myshort);
[myData appendBytes:&myshort length:sizeof(myshort)];
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden