Re: max size of [NSString stringWithContentsOfFile:] ?
Re: max size of [NSString stringWithContentsOfFile:] ?
- Subject: Re: max size of [NSString stringWithContentsOfFile:] ?
- From: Ondra Cada <email@hidden>
- Date: Wed, 29 May 2002 13:24:12 +0200
On Wednesday, May 29, 2002, at 11:44 , Martin Bauer wrote:
i am using the (convenient) stringWithContentsOfFile: function to read in
text files;
in the documentation i see that length: returns an unsigned int, meaning
that the maximum length of a string is 65535 characters, am i getting
this right?
You are not: we happily live in 32-bit world, making so the biggest
unsigned it four milliards (billions if you are from U.S.).
therefore, related to the "scannerWithString" thread of last week, if i
want to read in a really large file
If you wanted to read a *really* large file (milliards of bytes) you have
to go other API anyway, for there would be problems with available address
space. Though, up to hundreds of thousands bytes you don't need to worry
the slightest bit. Millions is a zone which can be loaded into RAM without
real problems, but it might be somewhat inefficient (depends, of course,
also on what you want to do with the data).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.