giampaolo / pyftpdlib

Extremely fast and scalable Python FTP server library
MIT License
1.65k stars 266 forks source link

Move received file to final destination only after writing is complete? #557

Closed coproc closed 2 years ago

coproc commented 2 years ago

When another application polls a directory, into which the FTP server writes a file: is there a possibility to check whether the file is completly written? A simple solution would be that the FTP servers downloads the file's content to a temporary file, which is moved to the final destination only after having received the complete data. Is something like this possible with pyftpdlib?

giampaolo commented 2 years ago

Take a look at the docs. There are callback methods of FTPHandler class that are invoked on successful download/upload. You can override them and put logic in there.

coproc commented 2 years ago

Thanks! That will help to solve the problem.