Re: Need to find newest file in dirs

From: Date: Thu, 08 Aug 2002 15:07:02 +0000
Subject: Re: Need to find newest file in dirs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111664@lists.php.net to get a copy of this message
This will be very OS-specific. The other problem will be that I *think* the only date associated with a file is the date last modified, NOT the date last written to HDD, but of course, that will vary with some OS's. When they upload, do they FTP, or do it via PHP scripts / browser? If so, then you can keep track of the latest files with either the file system or with a mysql database... Justin French on 09/08/02 12:55 AM, Mike Carter (mikec@aviate.org) wrote: > Hello all. I have a number of directories into which users can deposit > pictures which are displayed on the Web through a PHP viewer I wrote. > > I'd like to add the ability to show which user was the last to upload a file > to their directory so that as you visit the site you can see where new files > are without looking through every user's picture directory. > > The directory structure is dynamic; user's dirs come and go, and their > contents change. Here is the current structure: > > dir pics > |-- User1 > |-- User2 > |-- User3 > > The end result I am looking for is the directory name which contains the > newest *.gif or *.jpg file. Then I'll either colour-code the username on the > web site or just print a line saying "Last upload: August 10, 2002 by > User1". Any help would be appreciated! > > Thanks.. > MikeC > >

« previous php.general (#111664) next »