Portability Function: Repositions a file specified by a Fortran external unit.
Module: USE DFPORT
Syntax
SEEK_SET = 0 | Beginning of the file |
SEEK_CUR = 1 | Current position |
SEEK_END = 2 | End of the file |
Results:
The result is of type INTEGER(4). The result is zero if the repositioning was successful; otherwise, an error code, such as:
The file specified in lunit must be open.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
Example
USE DFPORT
integer(4) istat, offset, ipos
character ichar
OPEN (unit=1,file='datfile.dat')
offset = 5
ipos = 0
istat=fseek(1,offset,ipos)
if (.NOT. stat) then
istat=fgetc(1,ichar)
print *, 'data is ',ichar
end if