Re: Variable-sized lines of text in linked list



Bartc wrote:

.... snip ...

Reading an entire file into memory is an admirable idea, but is
frowned on in this newsgroup for various reasons: the size of a
file is impossible to determine, or could change while you're
reading the file, or because it might be a 100GB monster you
therefore should never attempt this even for tiny files.

That doesn't mean you shouldn't do it; just keep quiet about it
here :-)

Disagree. For some operations, it is virtually necessary. For
example the freverse exercise used as a test for ggets, which
reverses the content of an entire text file, byte by byte.

At the same time bear in mind that many, if not most, general
systems today supply virtual memory. That means that malloc won't
run out of space until the disk does, to all practical purposes.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Programming in standard c
    ... I consider having the text file size used for reading the file into ... memory to be used insufficiently often to make it worth caching it. ... size may suck significantly more than getting the binary-mode size ... NOT precalculate the size) and reallocing when needed ...
    (comp.lang.c)
  • Re: Noise Level of the PowerMac G5
    ... Or is it just a little bit more memory slots, ... If you are spending most of your time reading, thinking and editing ... I may have 10 to 15 apps open at once and switching between them a lot, ...
    (comp.sys.mac.misc)
  • Re: Large text file - in memory ( > 60mb)
    ... The file is over 64mb in size, reading it line by line to do a search ... while running the app, it would mean reading/searching the>64mb file many ... Then I have to show this record found (wich ... maybe creating a datatable to ease the search but I'm pretty sure memory ...
    (microsoft.public.dotnet.framework)
  • Re: Off Topic: Memory
    ... Given that my memory is something of a concern to me, ... I've only just started reading it but it addresses the causes ... - the rather haphazard way our brains are built, sort of like kludged ... P.S. haven't tried the test yet - keep forgetting ...
    (rec.music.makers.guitar.acoustic)
  • Re: Programming in standard c
    ... may grow larger between the query and the reading. ... That wider programming environment can provide guarantees ... and learned my craft in the days when memory was ...
    (comp.lang.c)