Sign in to follow this  
Followers 0
IndyUK

check for complete file

3 posts in this topic

Hi All,

I'm working on a script that uses the Word library to convert documents into PDF versions, but have come across a problem. The way the script works is to poll a folder for incoming .doc files. This works great for most files. However, the problem happens when the incoming files are quite large and are still in the process of being copied and the AutoIT script detects them and tries to open them (well the Word object).

How can I check that any file that is being copied only gets processed if it has completed?

Thanks

Share this post


Link to post
Share on other sites



Maybe try a FileOpen() and see if that is successful assuming it will fail when the copy process is still happening?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I recently had the same problem waiting for files created by PDFWriter running on a server. I use the fileopen approach but had to add an addinional wait (for about 1 sec) to be sure the PDF conversion had finished.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0