Re: Programming in standard c
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Thu, 27 Dec 2007 21:21:37 +0100
Erik Trulsson wrote:
jacob navia <jacob@xxxxxxxxxx> wrote:I just can't imagine a file system that doesn't provide a way
of knowing the length of a file.
Your imagination is obviously not very good.
Take for example CP/M.
This system is a good example of a currently widely
used system isn't it?
The solution for that system is very simple.
filesize reports number of blocks times the size of each block.
Period. Of course this is not the size of the useful bytes but...
who cares? CP/M users know that!
Another example would be a file stored on a magnetic tape. There it might not be
possible to find out how large the file is without reading the file until
you reach an end-of-file marker. I am fairly certain that such devices
are still in use.
so what?
filesize searches till the end of the file is found or if the device is
not supported returns an error.
What is obvious is that there are two alternatives:
1) Take the worst possible file system. Then standardize only
what that file system supports.
2) Take the most common situation for current machines and file
systems and standardize what those systems support.
Obviously you support (1). Everybody has to take care of CP/M,
that disappeared more than 20 years ago, System 3090, that disappeared
more or less at the same date...
Yours is the easiest solution: keep C at the PDP-11 / CP/M System 3090
level.
I would propose that those obsolete systems aren't even considered.
If someone implements C in them, then, it is up to the implementation
to see how the standard can be implemented.
For instance, and to go on with CP/M you could store the number
of used bytes in each block at the last 2 bytes of each block
isn't it?
Not very difficult to do.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.
- Follow-Ups:
- Re: Programming in standard c
- From: Randy Howard
- Re: Programming in standard c
- From: user923005
- Re: Programming in standard c
- From: Richard Heathfield
- 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: jacob navia
- Re: Programming in standard c
- From: Erik Trulsson
- Programming in standard c
- Prev by Date: Re: Programming in standard c
- Next by Date: Re: working with bitmaps in C
- Previous by thread: Re: Programming in standard c
- Next by thread: Re: Programming in standard c
- Index(es):