WinXP -> OpenVMS tests reproduced using C++ test pro

COLLOT Jean-Yves jean-yves.collot at cofiroute.fr
Wed Sep 29 10:08:29 GMT 2004


> The stat() or fstat() functions should return the correct 
> results of the real size of the file.  
> In the standard fields, they should have the highest
> byte written in the file.

I am not sure it should. Anyway, it does not and, as far as I know, it never
did in DECC or VAXC RTL history.

> If the stat()/fstat() calls are not doing this, then a small reproducer
> needs to be submitted to HP so that the stat() call can be fixed.

Here it is:

-----CUT HERE--------------
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <stat.h>
main()
{
        char buffer[1024];
        FILE *tst;
        int i;
        int n;
        struct stat st;

        tst = fopen ("TST.DAT", "w");
        for (i=0;  i<10;  i++)
        {
            n = fwrite (buffer, 1024, 1, tst);
        }
        n = stat ("TST.DAT", &st);
        printf ("File Size before close = %d\n",st.st_size);
        fclose (tst);
        n = stat ("TST.DAT", &st);
        printf ("File Size after close = %d\n",st.st_size);
        exit(0);
}
-----CUT HERE--------------

> My guess is that it should only induce a delay, but likely 
> not as bad as what it is fixing.

I agree.

JYC



More information about the samba-vms mailing list