FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Does this indicate a bug in PHP?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Does this indicate a bug in PHP? [message #178908] Thu, 23 August 2012 23:36 Go to previous message
Vlatko urlan is currently offline  Vlatko urlan
Messages: 2
Registered: May 2011
Karma:
Junior Member
Pay attention to the different mtimes reported.

vlatko@david:/tmp/mtimeTests$ php5 -v
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 20:08:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH


vlatko@david:/tmp/mtimeTests$ ll
total 56
-rw-r----- 1 vlatko vlatko 51946 Kol 23 19:01 img.jpg


vlatko@david:/tmp/mtimeTests$ php5 -r 'echo filemtime("img.jpg") . "\n";'
****1345741275****


vlatko@david:/tmp/mtimeTests$ php5 -r '$zip = new ZipArchive(); $zip->open("test.zip", ZIPARCHIVE::CREATE); $zip->addFile("img.jpg"); $zip->close();'


vlatko@david:/tmp/mtimeTests$ php5 -r '$zip = new ZipArchive(); $zip->open("test.zip"); print_r($zip->statIndex(0));'
[snip]
[mtime] => ****1345741274****
[snip]


vlatko@david:/tmp/mtimeTests$ zip update test.zip
adding: test.zip (stored 0%)
vlatko@david:/tmp/mtimeTests$ php5 -r '$zip = new ZipArchive(); $zip->open("test.zip"); print_r($zip->statIndex(0));'
[snip]
[mtime] => ****1345741274****
[snip]



I detected this while trying to update a ZIP archive using PHP. Obviously I tried to compare filemtime for each file with what ZipArchive reported and realized that they are never the same. What is going on here?

I've put the image up so that you can try with the exact same one: http://david.evorion.hr/img.jpg

--
Vlatko Ć urlan
[Message index]
 
Read Message
Read Message
Previous Topic: Programming Rates
Next Topic: DOMDocument::saveHTML() Method Not Accepting Single Argument
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 09:35:33 GMT 2024

Total time taken to generate the page: 0.04410 seconds