> IF Readable(SubStr(cMedSearch,1,6)+laFileList[i, 1]) > DO Destiny > ELSE > Wait Window "*** File not Readable! "+laFileList[i, 1]+CHR(13)+; > "Probably being created now!" NoWait > ENDIF > >>PROCEDURE Readable && Check to see if the file is readable >> PARAMETER cFile >> LOCAL m.nFileReady >> m.nFileReady = FOPEN(cFile) >> IF m.nFileReady = -1 >> RETURN .F. >> ELSE >> =FCLOSE(m.nFileReady) >> RETURN .T. >> ENDIF >>ENDPROC >> >>PROCEDURE Destiny >> nTest= 0 >> gnOrigin = FOPEN(SubStr(cMedSearch,1,6)+laFileList[i, 1],1) >> * ELB Debug: Destination I:\BBS\DATA\CLAIMS\NSF\"+cDestDirect >> gnFile = FCREATE('c:\'+cDestDirect+'\'+laFileList[i, 1]+cFileExt) >> IF gnFile < 0 >> WAIT WINDOW NOWAIT '*** Could not create file! '+laFileList[i, 1]+cFileExt >> ELSE >> DO WHILE !FEOF(gnOrigin) >> nTest= nTest+ 1 >> m.buffer = FGETS(gnOrigin) <b> wait window m.buffer </b> && FOR DEBUG PURPOSE >> nFAIL=FPUTS(gnFile, m.buffer) >> IF nFAIL = 0 .OR. nTest > 6 >> nERRCNT= nERRCNT+ 1 >> WAIT WINDOW NOWAIT "*** ERR WRITING RECORD "+laFileList[i, 1]+ ' in '+cDestDirect >> =FCLOSE(gnFile) && Close NEW file >> =FCLOSE(gnOrigin)&& Close Original File >> RETURN >> ENDIF >> ENDDO >> =FCLOSE(gnFile) && Close NEW file >> =FCLOSE(gnOrigin)&& Close Original File >> ENDIF >>Yes, very strange. Try to check buffer right after you read it. You may add fflush() at the end to ensure, that changes are saved...