Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I recognize a file to delete
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00573345
Message ID:
00573962
Vues:
27
>>This is strange -
>>The Record length should be 320 char max!
>>The File Size could be enormous...
>>
>>I get the correct file (BUT EMPTY) in correct directory ...
>>Tested for 6 recs
>>read-in-rec buffer is always empty???
>>
>>
>            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...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform