Re: Programming in standard c



On Dec 27, 12:21 pm, jacob navia <ja...@xxxxxxxxxx> wrote:
Erik Trulsson wrote:
jacob navia <ja...@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!

Here is a machine (HP RX/1600 Itanium running OpenVMS) that reports
its file sizes in blocks.

Next Cmd: dir/size

Directory DKA0:[000000.CONNX75.VMS-BINARIES]

LINK.COM;6 2
VAXCRTL.OPT;6 1
ZIP.AXP_OLB;6 730
ZIP.HLP;6 49
ZIP.I64_OLB;6 871
ZIP.VAX_DECC_OLB;6 218
ZIP.VAX_VAXC_OLB;6 201
ZIPCLI.AXP_OLB;6 292
ZIPCLI.I64_OLB;6 459
ZIPCLI.VAX_DECC_OLB;6
96
ZIPCLI.VAX_VAXC_OLB;6
84
ZIPCLOAK.AXP_OBJ;6 61
ZIPCLOAK.I64_OBJ;6 54
ZIPCLOAK.VAX_DECC_OBJ;6
22
ZIPCLOAK.VAX_VAXC_OBJ;6
22
ZIPNOTE.AXP_OBJ;6 70
ZIPNOTE.I64_OBJ;6 60
ZIPNOTE.VAX_DECC_OBJ;6
26
ZIPNOTE.VAX_VAXC_OBJ;6
26
ZIPSPLIT.AXP_OBJ;6 81
ZIPSPLIT.I64_OBJ;6 83
ZIPSPLIT.VAX_DECC_OBJ;6
31
ZIPSPLIT.VAX_VAXC_OBJ;6
29
ZIPUTILS.AXP_OLB;6 240
ZIPUTILS.I64_OLB;6 432
ZIPUTILS.VAX_DECC_OLB;6
62
ZIPUTILS.VAX_VAXC_OLB;6
59
ZIP_CLI.HLP;6 43

Total of 28 files, 4404 blocks.
Next Cmd:

each of those file sizes is 512 byte increments. You can buy a new
one today from HP, if you want.
http://h71000.www7.hp.com/openvms/hw_supportchart.html



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.

The fact that sizes are not reported in bytes on some systems is not
nearly so large a hurdle as the fact that on live systems file sizes
are constantly changing. You are proposing a function that cannot
possibly work (reporting file size on a live file). It's not an
intelligent API.
.



Relevant Pages

  • Re: Splitting Files into Multiple Folders for Read Performance
    ... 100,000 PDF reports per month for several years, which has now turned ... ALL their legacy PDF reports to still be available through our new ... the names of the folders are ...
    (microsoft.public.windows.file_system)
  • Re: too many modules
    ...  Crystal Reports may be an option to pull a large amount of reports ...   John Spencer ... I.e., step back, look at the bigger picture of business objectives, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Cobols File System Vs. RDBMs...
    ...   What do you man by columns in an index file? ... The Cobol index file system is considered to be Closed simply ... gives the user the ability to create such reports using a GUI. ...
    (comp.lang.cobol)
  • Re: Hostile media phenomenon
    ... media bias. ...     We should not be so quick to equate science with reality when it mirrors ... when has the media ever deviated from the Pro-Palestinian (false) ... Same incident, same reports, same ...
    (soc.culture.jewish.moderated)
  • Re: Programming in standard c
    ... I am looking for a method of obtaining the size of a file, ...   ... I have already said in previous posts that OpenVMS file size may be ... nearly so large a hurdle as the fact that on live systems file sizes ...
    (comp.lang.c)