Re: Cocoa version of the fstream lib?
Re: Cocoa version of the fstream lib?
- Subject: Re: Cocoa version of the fstream lib?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Fri, 6 Feb 2004 18:05:42 +0100
At 7:10 Uhr -0600 06.02.2004, Jeremyah Payne wrote:
How would i do something like
ifstream fin;
fin.open("somefile.txt");
fin>>data;
fin.close();
You'd use NSInputStream. It requires 10.3, though. If you need to
support something earlier than that, either load the entire file into
an NSData, then mess with its -bytes, or use an NSFileHandle to get
bits and pieces out.
NSScanner may also be helpful if you're reading text data and want
scanf()-like behaviour.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.