Re: Programming in standard c
- From: "Bart C" <bc@xxxxxxxxxx>
- Date: Fri, 28 Dec 2007 21:45:28 GMT
"Eric Sosman" <esosman@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:jqqdnT6R6ulVsejanZ2dnUVZ_oKhnZ2d@xxxxxxxxxxxxxx
Bart C wrote:
[...]
I don't know how to deal with /var/adm/messages or similar. Suppose I
read byte-by-byte as recommended then someone updates the beginning of
the file? Maybe it's foolhardy to even attempt making a copy of such a
file. I'm not allowed to lock it because that's also frowned upon. What
exactly can one do with such a file?
There are at least two problems to be faced when dealing
with /var/adm/messages. First, the file grows as the system
Well, we can class that sort of file as Special and deal with it With Care.
Or pehaps choose not to deal with it at all. The point is most input files
(it is mostly input ones you want to read!) are known to be well-behaved (eg
config files/support files of an application) and can be dealt with less
strictly.
If we have to worry about multi-process access than we may have to consider
our entire application may suddenly disappear in a puff of smoke. It's best
not to worry about it.
Personally, I don't think much of the read-it-all-in approach
to handling data that's in files. That's because I'm from the
Old School, and learned my craft in the days when memory was
scarce and expensive.
Same here.
You
read the enormous CAD model and build data structures while reading
it; all the data winds up in memory, but you never have or need
an "image" of the entire file as it looks on disk.
Yes, I've written CAD-type software for 8-bit and MSDOS. That was fun.
Now, however, you've got 1GB RAM or whatever sitting there and you need to
do *something* with it. I'm talking about at least desktop PCs of course.
Bart
.
- Follow-Ups:
- Re: Programming in standard c
- From: Eric Sosman
- Re: Programming in standard c
- From: user923005
- Re: Programming in standard c
- References:
- Programming in standard c
- From: jacob navia
- Re: Programming in standard c
- From: jameskuyper
- Re: Programming in standard c
- From: Erik Trulsson
- Re: Programming in standard c
- From: user923005
- Re: Programming in standard c
- From: jacob navia
- Re: Programming in standard c
- From: Richard Heathfield
- Re: Programming in standard c
- From: jacob navia
- Re: Programming in standard c
- From: user923005
- Re: Programming in standard c
- From: Richard
- Re: Programming in standard c
- From: Eric Sosman
- Re: Programming in standard c
- From: Bart C
- Re: Programming in standard c
- From: Eric Sosman
- Programming in standard c
- Prev by Date: Re: Programming in standard c
- Next by Date: Re: Programming in standard c
- Previous by thread: Re: Programming in standard c
- Next by thread: Re: Programming in standard c
- Index(es):
Relevant Pages
|