[PHP]Keep the modification date of a file when archiving it.

2008-10-23 Thread Bastien Helders

Hi,

When I'm archiving files in a ZIP file, using the class ZipArchive, the 
modification date is modified to when ZipArchive::close is called. I would like 
to keep the original modification date. Is that even possible?

Best Regards,
Bastien Helders

_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp

Re: [PHP]Keep the modification date of a file when archiving it.

2008-10-23 Thread Kyle Terry
Before changing the file, use the filemtime()
http://us3.php.net/filemtimefunction to get the mod date, then use
touch() http://us3.php.net/manual/en/function.touch.php to set the date
after you change the file.

On Thu, Oct 23, 2008 at 2:25 AM, Bastien Helders
[EMAIL PROTECTED]wrote:


 Hi,

 When I'm archiving files in a ZIP file, using the class ZipArchive, the
 modification date is modified to when ZipArchive::close is called. I would
 like to keep the original modification date. Is that even possible?

 Best Regards,
 Bastien Helders

 _
 Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !
 Téléchargez-le maintenant !
 http://www.windowslive.fr/messenger/1.asp




-- 
Kyle Terry | www.kyleterry.com


RE: [PHP]Keep the modification date of a file when archiving it.

2008-10-23 Thread Boyd, Todd M.
 -Original Message-
 From: Bastien Helders [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 23, 2008 4:26 AM
 To: php-general@lists.php.net
 Subject: [PHP]Keep the modification date of a file when archiving it.
 
 
 Hi,
 
 When I'm archiving files in a ZIP file, using the class ZipArchive,
the
 modification date is modified to when ZipArchive::close is called. I
 would like to keep the original modification date. Is that even
 possible?

www.php.net/touch

bool touch  ( string $filename  [, int $time  [, int $atime  ]] )

Attempts to set the access and modification times of the file named in
the filename parameter to the value given in time . Note that the access
time is always modified, regardless of the number of parameters.

If the file does not exist, it will be created.

--

So... I would say just call that on your file after you
ZipArchive::close it.

HTH,



Todd Boyd
Web Programmer

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php