From:             badocs at tbaytel dot net
Operating system: Linux
PHP version:      4.3.10
PHP Bug Type:     *Calendar problems
Bug description:  Modification Date

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 bug report at http://bugs.php.net/?id=33552&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33552&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33552&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33552&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33552&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33552&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33552&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33552&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33552&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33552&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33552&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33552&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33552&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33552&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33552&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33552&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33552&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33552&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33552&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33552&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33552&r=mysqlcfg

Reply via email to