Re: Programming in standard c



On Dec 27, 2:01 pm, jacob navia <ja...@xxxxxxxxxx> wrote:
user923005 wrote:
Here is a machine (HP RX/1600 Itanium running OpenVMS) that reports
its file sizes in blocks.

[big snip]



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

If you have one of that systems and your trash is full so you can't get
rid of it, then you can do the following

http://h71000.www7.hp.com/wizard/wiz_5424.html
Obtaining RMS file size?
Hello Mr Wizard

I am looking for a method of obtaining the size of a file, NOT the
allocation
  from within a Fortran routine. I thought this would be a simple
trivial task
  but alas I am proved wrong.

Can you help.

Regards Jim
Answer
     RMS does NOT keep track of the number of user data bytes in a file.
     The only reliable way to obtain that, is to read the file and count!

So there you have the answer!

If you are using that system expect that filesize() will take some time.

So What?

Should we ALL suffer because some brain-dead system exists somewhere?
No.

Only the users of THAT system should be the ones of coping with their
choices not all others!

I have already said in previous posts that OpenVMS file size may be
obtained by table scan. This is a very unfriendly operation on a live
system and you had better have a darn good reason for doing it. You
have to lock each record as you read it to get a result that is
accurate even for what you saw at the instant of operations (and -- of
course -- each record may be changed or deleted the moment you move to
the next.

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.  

The function returns the size AT THE TIME OF THE CALL. I have repeated
this AGAIN AND AGAIN and I am repeating here AGAIN:

"AT THE TIME OF THE CALL"

But it can change the instant afterwards, so that information has
literally no value at all.

If the file size changes later IT IS NOT THE PROBLEM OF THE API!

You are proposing a function that cannot
possibly work (reporting file size on a live file).  It's not an
intelligent API.

If you say that because it takes a file pointer the file is "live"
that's another question. Maybe it would better be a file NAME and not a
handle to a file.

What is important is that we can use a portable function in MOST file
systems. I am tired of this levelling through the worst that is going on
  here.

The value of collecting a number that can change in an instant seems
rather strange. I assume you want to use it for something (such as
allocating memory so that you can read that file into memory). If the
number cannot be used for that (or any other) purpose, then what good
is the number?

This insistence of getting the WORST system then FORCING all other
people to adapt themselves to that pile of sh...!

CP/M, it is DEAD.
OpenVMS? It is dying.

We make millions of dollars off of OpenVMS. That includes plenty of
new development. The fact that such systems exist shows that your
arguments were simply wrong.

Anyway, I always avoided the VAX, and I am glad I did!

You are shown to be wrong. Did it make you feel foolish?
.



Relevant Pages

  • Re: Programming in standard c
    ...   CP/M users know that! ... Here is a machine that reports ... each of those file sizes is 512 byte increments. ... Then standardize only ...
    (comp.lang.c)
  • Re: FAQ 5.38 How do I select a random line from a file?
    ... with huge numbers of lines or large file sizes, ...   2. ... Read the subsequent lines in the file and, for each line, replace ... that is what the FAQ was saying. ...
    (comp.lang.perl.misc)
  • Re: I got a Crown on my tooth today
    ... are calling out file sizes. ...   The larger the number the bigger the ...
    (rec.sport.football.college)
  • Re: Open Source on OpenVMS - A Progress Report
    ... VMSblog as well as Twitter and Facebook. ... important to making the Open Source on OpenVMS Project succeed. ...    LinkedIn.com OpenVMS Community Group and other DEC groups on the site ... Source Forge is not dedicated to VMS. ...
    (comp.os.vms)
  • Re: Connecting OS-X to OpenVMS?
    ... using different credentials: Windows only ... VAXman- A Bored Certified VMS Kernel Mode Hacker   ... "Use of the Common Internet File System requires OpenVMS Version 8.2 ...
    (comp.os.vms)