Hi again
Having read through the documentation more thoroughly, it does indeed seem there is no standard way to make sure a direct access file is exactly N bytes long.
I'll go with a short C function and some preprocessing directives for posix/win32/others.
Hi
I'm writing what should be a portable Fortran library in Fortran 77.
One of the routines should shorten a (direct access) file. For example, if a file is 100 bytes long, you should be able to throw away the last 10 bytes.
In gfortran, I can open a file with record length 1, read record N...
In thread214-1248457, guillaume asked how to find
the size of a binary file in Fortran.
I had excactly the same problem, but could not find a portable solution to it on the internet, so I post mine here in the hope that Google will list it.
I made a binary search, using that the READ statement...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.