Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for file transfer completion
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00353899
Message ID:
00354098
Vues:
15
>Simple, elegant and it works. Thanks Ed.
>

Thanks. Now, after bitching about inadequate testing, this has not been tested under Win2K, and there might be issues if a tool like GetRight is in the loop - GetRight will download segments of a file offered at several sites in parallel, and might write and release the file after each segment finished; I don't know the detailed operations for everything. Most FTP implementations download to a temp file and rename to the real target name on completion, or open it in create mode and write, which would prevent you from opening it in unbuffered read/write mode as shown below.

That should cover it.

>>>Is there any way in VFP6.0 that you can check if a file has finished writing to a directory? We have a program that checks a directory to see if a file has been FTPed in.
>>>
>>>I am looking for a way to determine that the file has completed it’s transfer and it is now safe to move or use.
>>>
>>
FUNCTION IsItSoupYet
>>LPARAMETER cAbsoluteFilePath
>>LOCAL nFH
>>nFH = -1
>>IF FILE(FULLPATH(cAbsoluteFilePath))
>>   nFH = FOPEN(FULLPATH(cAbsoluteFilePath),12)
>>   IF nFH # -1
>>      =FCLOSE(nFH)
>>   ENDIF
>>ENDIF
>>RETURN (nFH # -1)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform