Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

stringWithContentsOfFile question

 
   Mac (Home) -> Programmer Help RSS
Next:  simple assembler question  
Author Message
Jim

External


Since: Apr 10, 2007
Posts: 38



(Msg. 1) Posted: Thu May 24, 2007 1:15 pm
Post subject: stringWithContentsOfFile question
Archived from groups: comp>sys>mac>programmer>help (more info?)

Using stringWithContentsOfFile I can load an NSString with the contents
of a file (obviously).

What are the practical limits with regard to the size of file that could
be handled?

Jim
--
Find me at http://www.ursaMinorBeta.co.uk

My lucky star is probably Eta Carinae.
Back to top
Login to vote
Gregory Weston

External


Since: Jun 06, 2005
Posts: 660



(Msg. 2) Posted: Thu May 24, 2007 1:15 pm
Post subject: Re: stringWithContentsOfFile question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <slrnf5b0f4.ilq.jim RemoveThis @odin.magrathea.local>,
Jim <jim RemoveThis @magrathea.plus.com> wrote:

> Using stringWithContentsOfFile I can load an NSString with the contents
> of a file (obviously).
>
> What are the practical limits with regard to the size of file that could
> be handled?
>
> Jim

The NSString documentation references this from NSString.h

NSMaximumStringLength

A constant to define the maximum number of characters in an NSString
object.

#define NSMaximumStringLength (INT_MAX-1)

The practical limits I would expect are dependent quite a bit on the
specific machine and the amount of space available in the process's
address space; I wouldn't necessarily expect great performance handling
a 3GB string on a machine with 512MB of RAM, for example.
Back to top
Login to vote
Jim

External


Since: Apr 10, 2007
Posts: 38



(Msg. 3) Posted: Thu May 24, 2007 3:17 pm
Post subject: Re: stringWithContentsOfFile question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <uce-F79B96.10063024052007.RemoveThis@comcast.dca.giganews.com>, Gregory Weston wrote:
> In article <slrnf5b0f4.ilq.jim.RemoveThis@odin.magrathea.local>,
> Jim <jim.RemoveThis@magrathea.plus.com> wrote:
>
>> Using stringWithContentsOfFile I can load an NSString with the contents
>> of a file (obviously).
>>
>> What are the practical limits with regard to the size of file that could
>> be handled?
>>
>> Jim
>
> The NSString documentation references this from NSString.h
>
> NSMaximumStringLength
>
> A constant to define the maximum number of characters in an NSString
> object.
>
> #define NSMaximumStringLength (INT_MAX-1)
>
> The practical limits I would expect are dependent quite a bit on the
> specific machine and the amount of space available in the process's
> address space; I wouldn't necessarily expect great performance handling
> a 3GB string on a machine with 512MB of RAM, for example.

Overall performance would be a major factor for me, and I expect the
largest file I'd be handling this way would be in the 1GB region, but
mostly in the 250MB range.

Thanks for the info.

Jim
--
Find me at http://www.ursaMinorBeta.co.uk

My lucky star is probably Eta Carinae.
Back to top
Login to vote
Tom Harrington

External


Since: Jul 25, 2005
Posts: 193



(Msg. 4) Posted: Thu May 24, 2007 3:17 pm
Post subject: Re: stringWithContentsOfFile question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <slrnf5b7iv.mtc.jim.TakeThisOut@odin.magrathea.local>,
Jim <jim.TakeThisOut@magrathea.plus.com> wrote:

> Overall performance would be a major factor for me, and I expect the
> largest file I'd be handling this way would be in the 1GB region, but
> mostly in the 250MB range.

Depending on what you're doing with these files, you might want to
consider loading them as memory-mapped files. NSData objects can be
initialized this way, and you should be able to get an NSString from
there.

--
Tom "Tom" Harrington
MondoMouse makes your mouse mightier
See http://www.atomicbird.com/mondomouse/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Question about NSTabView - HI I don't know if Gorm/Interface Builder questions are on topic in here, the FAQ doesn't seem to say. Anyway, I had an application working fine with its NSTableView (the delegate was my AppController class). I used Interface Builder to create a..

MTCoreAudio question - Hi, I'm using MTCoreAudio and need to record x seconds (say 5 seconds) of audio into one buffer. I've got the sammple rate but how do I calculate the buffer size? One of the examples I found uses:- // about 25 seconds of recording time #define..

One more C++ cout question - I have a hex value, 0x14000, and I want to output it as, 0x00014000. Is it possible to get this output using std::cout? Thanks

Novice question about NSButton - Hello, I have been working my way through developing my first Cocoa app, (a calculator, naturally) and have hit a bit of a wall toward the end. Apologies in advance for the long post. The problem: All my keys are straight NSButtons with a key..

simple assembler question - Hello. My name is Robert and after a long time beeing out of work I am glad to introduce myself. I have 4 years experience as a commercial software developer. I began with the SE/30 and OS 6. Having had a break of 5 years I am back on the Mac Platform..
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact