Detect with php if files load or open

I have a PHP script that opens a local directory for copying and processing some files. But these files can be incomplete, because they are downloaded by the slow FTP process, and I do not want to copy or process files that have not yet been fully downloaded.

Is it possible in PHP to find out that a file is still being copied (i.e. read) or written to?

I need my script to only process files that have been fully downloaded.

Now the ftp process uploads files in parallel, and it takes more than 1 second for every file size change, so this trick now doesn't work for me, and any other method offers

+5
source share
3 answers

script FTP? , script, , [FILENAME].complete( ) , script , , *.complete .

+4

+1 @MidnightLightning . , :

, , filesize() . , .

, , . filesize(), , . , . , , - . - .

+3

, , Unix, fuser / lsof. fuser , , lsof ( , fifos,.so ..). , , .

Sysinternals, . handle

+2

All Articles