On Wed, Apr 16, 2008 at 9:53 AM, Daniel Brown <parasane@xxxxxxxxx> wrote: > On Wed, Apr 16, 2008 at 9:37 AM, Thiago Pojda > <thiago.pojda@xxxxxxxxxxxxxxxxxx> wrote: > > > > I don't know if I'm just lazy or stupid (or both). > > Stupid, definitely not. Lazy.... well, maybe. ;-P > > > > I went into a similar issue few weeks ago and my solution was to add a > > function to delete files created in the last X hours (mine was 24), and call > > it on the same script that creates the files. > > > > Which means it tries to clean up old files every time it creates a new one. > > > > Is that any good for you guys? > > It's a great idea in theory, but my concern is the duration in > which the files are unlink()'d from the system; the function is called > when another file is created - presumably when another user accesses > the page - which then lengthens the time before each user after the > first will be able to see the end result. > In addition to the added time, aren't there any problems with race conditions if two users try to create a file at the same time and each user's script tries to clean the same files at the same time? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php