>Hi Gang!
>
>Problem here....
>
>I wrote this code, and our demo people are setting it up on a Window 7 64 bit PC.....
>
>This code is run every 5 minutes from a timer.
>
>It's purpose is to go out to a webservice and retrieve a text file of records to be processed locally. Worked fine here in 32 and 64 bit on OUR PCs the past 2 days..... but when the demo guys set things up, it was not exactly like our setups.... they had some permission problems on some of the folders......
>
>When the code ran today on the demo PC, during lunch.... and the tester came back... he found a
>"File Access is Denied c:\temp\ivrfill.txt"
>
>Check how it is deleted below....
>
>
>IF FILE('c:\temp\IVRFILL.TXT')
> lnHandle = FOPEN('c:\temp\IVRFILL.TXT')
> IF lnHandle > 0
>* Seek to end of file to determine number of bytes in the file.
> nSize = FSEEK(lnHandle, 0, 2)
> IF nSize <= 0
>* If file is empty, display an error message.
> WAIT WINDOW "This file is empty!" NOWAIT
> ELSE
>* If file is not empty, store the file's contents in memory
>* and display the text in the main Visual FoxPro window.
> = FSEEK(lnHandle, 0, 0)
> IF nSize > 0
> DO WHILE NOT FEOF(lnHandle)
> lcStringSegment = FGETS(lnHandle)
> THIS.PARENT.m_ProcessIVRstringtotable(lcStringSegment)
> ENDDO
> ENDIF
> ENDIF
>*Get rid of the file, now that we are done with it....
> FCLOSE(lnHandle)
> DELETE FILE c:\temp\IVRFILL.TXT
> ENDIF
>
>
>It normally worked fine here on both 32 and 64 bit PCs...... so............. is there a problem with the FCLOSE running before the DELETE FILE so quickly.... should I put a short time delay there so the file is sure to be closed by the time the DELETE FILE is called?
If the file is not too big, you can use filetostr, then alines and process each line.
If it's not broken, fix it until it is.
My Blog