#33552 [Opn->Fbk]: Modification Date
| From: | tony2001@php.net | Date: | Sun, 03 Jul 2005 19:18:23 +0000 |
| Subject: | #33552 [Opn->Fbk]: Modification Date | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81324@lists.php.net to get a copy of this message | ||
ID: 33552
Updated by: tony2001@php.net
Reported By: badocs at tbaytel dot net
-Status: Open
+Status: Feedback
-Bug Type: *Calendar problems
+Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 4.3.10
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-07-03 08:39:20] badocs at tbaytel dot net
Description:
------------
I've noticed a very annoying bug.
I use a upload script with php to allow clients to upload their own web
pages. My intent was to have a table on the front page displaying the
most recently modified site. I do this by scanning the toplevel
directory for their usernames.
ie)
user1/
user2/
...And i find the most recently modified file and use that, compare
that date to other sites and generate a sorted list of sites. This was
also to be used for inactivity with accounts, so that a website that
wasn't being updated after a bit..would alert me to think about
removing it to save space.
Unfortunely, php does not set the file modification date when the file
is uploaded, and i've tried chmod() and touch() to attempt to correct
that by setting a date to no avail. I'm wondering how I can set the
modified date. I must be a noob if i'm not getting this correct.
Reproduce code:
---------------
// The code to automatically set the modification date, since php won't
automatically.
// so we upload a file to ($path . "/" . $filename), path is where the
file is to be uploaded to..
//now to manually set the damn modified time.
$newfile = "$path/$filename";
echo $newfile; // looks correct
chmod ($l, 0777); // set write.
touch ($l); // if i put this in a if state, it says it worked...but it
didn't.
// so far, no matter what, any file uploaded has the date of December
31 1969 18:00:00.
Expected result:
----------------
So, the one thing i could see as my screwup would be offering touch its
second argument, but the docs said that touch would auto-do it......
Other then that....I'm lost..and it's very annoying.
Can someone please offer a solution that sets the damned modification
date....with just php...because i'm under hosting and i don't know if i
have access to the ftp stuff with php that would probably solve this
problem in a alternate way...
OR...
does anyone know the function(s) that will display the creation
date...and if php even writes that on upload...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33552&edit=1