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 and use the ENDFILE statement.
This cuts away all but the first N bytes as desired. However, the Fortran 77 standard prohibits using ENDFILE on direct access files.
Is there a 'standard' trick for shortening files like this, or will I have to resort to another language for this particular functionallity?
Anders
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 and use the ENDFILE statement.
This cuts away all but the first N bytes as desired. However, the Fortran 77 standard prohibits using ENDFILE on direct access files.
Is there a 'standard' trick for shortening files like this, or will I have to resort to another language for this particular functionallity?
Anders