If you want to position file for sysread or syswrite, don't use seek--buffering makes its effect on the file's system position unpredictable and non-portable. Use sysseek instead.