Re: Programming in standard c
- From: "Serve Lau" <ni@xxxxxxx>
- Date: Sun, 30 Dec 2007 22:51:06 +0100
"user923005" <dcorbit@xxxxxxxxx> schreef in bericht news:893ebc34-1590-46cd-88fb-29795311d2b5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Dec 28, 4:32 am, Chris Torek <nos...@xxxxxxxxx> wrote:
In article <eaednRrgxJMrC-7anZ2dnUVZ8h2dn...@xxxxxx>[snip]
Malcolm McLean <regniz...@xxxxxxxxxxxxxx> wrote:
>/*
> function to slurp in an ASCII file
> Params: path - path to file
> Returns: malloced string containing whole file
>*/
I think we can improve this a great deal, with the result being
a function that is written entirely in Standard C and works in
every case in which it is possible for it to work, and -- by
calling a system-dependent function that the user is to supply,
but which may be replaced with a #define that simply returns 0
if desired -- is "reasonably efficient" as well.
I work for a database company, and most of our customers are large
customers. (E.g. huge US company, large university, government of
country x, etc.)
It is not at all unusual for a single file to be 20-100 GB. Needless
to say, you would not want to put this file into memory even if you
could do it.
The files I work with are also being modified constantly (though there
are occasionally windows of inactivity for some of them).
I am quite sure that the goal of reliably reading these sorts of files
into memory and doing something useful with them is literally
infeasible (not impossible, but the cost would make it so stupid that
nobody would want to do it).
What is your point? This DBMS doesnt come with an API to update the database? You have to use fread to get records? Surely not. The reasons for not including a function like filesize in the standard are getting funnier by the minute.
There are BTW more uses for a filesize function than just get the size to malloc memory with. How about for your DBMS and you want to create an administration tool where you can constantly monitor how big the files are. Just an extra thingie you would be able to do in standard C.
This is really getting silly, a function like filesize could be put into the standard and it would be useful. But as pointed out elsewhere in this thread this discussion wont help to get the function into it.
.
- Follow-Ups:
- Re: Programming in standard c
- From: Randy Howard
- Re: Programming in standard c
- References:
- Programming in standard c
- From: jacob navia
- Re: Programming in standard c
- From: Malcolm McLean
- Re: Programming in standard c
- From: Chris Torek
- Re: Programming in standard c
- From: user923005
- Programming in standard c
- Prev by Date: Re: confused..again
- 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
|