RE: [PHP] Check for open file

From: Date: Thu, 03 Mar 2011 20:23:38 +0000
Subject: RE: [PHP] Check for open file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-311644@lists.php.net to get a copy of this message
> Write the file with a temporary name and extension. Once the file is closed, > change the name to the pattern your server is looking for. Once you finish > processing it, either change the name again, or move it to a different > directory. Don't reuse the same file name, but add a numeric value which > increases every time you create it. Keep a log of which files have been > processed and any errors each one produced. > > Bob McConnell I can't require nor expect those copying the files into the share folder to do this. No, they will simply be grabbing a set of image files from one network share and drag them into this Samba share, as is. I'm not worried with what happens when PHP picks it up (name changes, moving to a diff folder, etc., etc.) I'm only concerned with the first step ... picking up the file only *after* it's done copying. I can run PHP as a timed crontask, but I need to figure out a safe way for it to either grab a file or leave it alone because it's not done yet.

« previous php.general (#311644) next »