Here is the code I am attempting (note that I split the text file into 4 700MB files and the fseek() works, but I would like to keep it in one file, if possible)
gnFileHandle = FOPEN("tapes1212.dat")
nSize = FSEEK(gnFileHandle, 0, 2)
IF nSize <= 0
WAIT WINDOW "This file is empty!" NOWAIT
ELSE
IF lCheck <> 'Y'
FOR X =0 TO nSize STEP 2264
= FSEEK(gnFileHandle, X)
cString = FREAD(gnFileHandle, 2264)
etc. etc. I process the data that comes in from here
endfor
endif
Thanks!
>Amanda, just to be clear - there are two parameters after the file handle - the number of bytes to move and the relative from position from which to move. To position at the end of the file you would issue:
>
>
>gnPosition = FSEEK(gnFileHandle, 0, 2)
>
>
>In your original post you were only passing one parameter after the file handle which was the number of bytes to move. If you do not specify the relative from position it defaults to from the start.
>
>If this still does work then please post your exact code here for us to see.
>
>Also, are you checking that the FOPEN() was succesfull by checking the returned file handle?
>
>
>>I just tried that and it is still returning 0. Any other thoughts?
>>
>>Thanks!!
>>
>>>The last (3) parametr must be set to 2, if You set this parametr to 0 You always go to the begin file !!!.
>>>
>>> parameter 0 - go to begin
>>> 1 - current file pointer position
>>> 2 - go end file
>>>
>>> wrong !!!! gnPosition = FSEEK(gnFileHandle, 0) // nothing do
>>> good gnPosition = FSEEK(gnFileHandle, 0, 2) // end of file
>>>
"In three words I can sum up everything I've learned about life : it goes on." - R. Frost
Amanda Brown
Supervisor/Programmer