• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 106
  • Last Modified:

How to wait for file to be closed before reading

I have my scanner here at the office FTP'ing scanned documents to a server.

Additionally, I have a php script running indefinitely checking the ftp upload folder and creating thumbnails for those PDF images.

The problem is, if the scanner hasn't finished writing the document to the ftp server, the script fails because it is not a valid PDF document.

I am using ghostscript to create the pdf preview if that helps and my ftp server is proftpd. The server is Ubuntu 14.04 LTS.
0
Mark
Asked:
Mark
1 Solution
 
MarkProgrammerAuthor Commented:
Never mind, solved this by setting the "hide files during upload" setting on proftpd server and skipping files beginning with .in.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now