discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableString -initWithFormat appends to existing text


From: Mick Bert
Subject: Re: NSMutableString -initWithFormat appends to existing text
Date: Thu, 19 Apr 2018 08:56:42 +0200

2018-04-18 17:15 GMT+02:00 David Chisnall <gnustep@theravensnest.org>:
> On 18 Apr 2018, at 10:23, Mick Bert <micbert75@gmail.com> wrote:
>>
>> Is it the preferable way?
>

> That depends a bit on what you mean by ‘preferable’.  If you mean
> ‘simpler’ or ‘cleaner code’, then I don’t think so.  If you mean
> ‘faster’ or ‘lower memory’, then you may find that using NSString’s
> -getBytes:… method into an on-stack buffer then write that using the
> lower-level C / C++ APIs.  In most cases, the overhead of the I/O is
> going to be sufficient that this won’t make a noticeable difference,
> but if you’re processing a lot of data and have NVMe storage then
> you might consider this.


Sometimes I have to process files several dozen of GByte large, 200
bilions of lines (it took a couple of minutes just to cont them :-D ).
I have successfully written perl scripts to process them, and it was
interesting. Now I would like to do it in a gnustep tool, just to
practice with base classes, and the language itself.

>> Are there any other class to work with
>> text-oriended files?
>
> Note that text-oriented files don’t really exist as an abstraction
> on most *NIX systems (though the C standard still likes to pretend
> that they do).  GNUstep / Cocoa don’t provide useful abstractions for
> this, though the C++ standard streams library does (not very good
> ones though, so I don’t really suggest using it).  David

Here I don't follow you any more. Whenever I have to write information
in a file, I always prefer readable form, so that I can access them
with a text editor, without the need of any particular tool (of any
particular version). At least as long as performance are concernd
(i.e. randomly seeking is needed, or syntax interpretation
is computationally too  heavy)

--
Mick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]