Re: reading in text files
Re: reading in text files
- Subject: Re: reading in text files
- From: jgo <email@hidden>
- Date: Fri, 1 Feb 2002 03:45:54 -0800
>
From: Ondra Cada <email@hidden> Fri, 2002-02-01 01:38:58 +0100
>
> Ben Mackin wrote at Thu, 2002-01-31 15:36:49 -0800:
>
>> ??? wrote:
>
>> NSArray *a=[[NSString stringWithContentsOfFile:theFile]
>
>> componentsSeparatedByString:@" "];
>
>>
>
>> If you need more impressive services, check NSScanner.
>
>
>
> myFile is large (can be up to 16000 bytes), so I don't think
>
> reading the whole thing into an NSString would be good.
>
>
That's not large, that's small. Such files can be read into
>
memory and worked on there without any caveats.
I'll bite. What if the file were 160MB... or 1.6GB?
How would one have it read in only a continuous series
of chunks and have it parse them, while minimizing monkeying
around with chunk boundary conditions?
John G. Otto, Eagle Scout, Knight, Cybernetic Praxeologist
Existence, Consciousness, Identity, Life, Liberty, Property, Privacy, Justice
<
http://gosc.nisus.com/~giovanni>