In the end, I used a watchdog timer combination and waited until I could open the file for writing
#If there is no error when trying to read the file, then it has completely loaded try: with io.FileIO(fileName, "r+") as fileObj: ''' Deal with case where FTP client uses extensions such as ".part" and '.filepart" for part of the incomplete downloaded file. To do this, make sure file exists before adding it to list of completedFiles. ''' if(os.path.isfile(fileName)): completedFiles.append(fileName) print "File=" + fileName + " has completely loaded." except IOError as ioe: print str(ioe)
source share