Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.0

Bug #8114 Files added on-the-fly not storing date
Submitted: 2006-07-04 14:20 UTC
From: jfernandez at electronic-group dot com Assigned: vblavet
Status: Closed Package: Archive_Tar (version 1.3.1)
PHP Version: 4.4.1 OS: RHEL
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-04 14:20 UTC] jfernandez at electronic-group dot com (Juan Fernández-Rebollos)
Description: ------------ Whenever a tar file is created on-the-fly and some files are stored in by using the addString method, neither the date nor any permissions are stored for each inserted file. This is a patch that makes those files to be created with the system timestamp and with permissions of rw-r---- Test script: --------------- --- Tar.php 2005-03-17 22:02:31.000000000 +0100 +++ TarModif.php 2006-07-04 16:15:20.000000000 +0200 @@ -973,7 +973,7 @@ $p_filename = $this->_translateWinPath($p_filename, false);; if (!$this->_writeHeaderBlock($p_filename, strlen($p_string), - 0, 0, "", 0, 0)) + time (), 438 - umask (), "", 0, 0)) return false; $i=0; Expected result: ---------------- The files created from memory have timestamps and permissions set.

Comments

 [2006-09-01 21:17 UTC] adam at pilorz dot net (Dot)
Sometimes (I have such situation in my script) it is better, when you can specify the date yourself. I've made a modification, which allows you do that. This patch allow you to specify the date in third parameter, and when the date is not specified, it uses the current timestamp. It is modified version of patched (with Juan Fernández-Rebollos's patch) Tar.php (the diff from original Tar.php) As the file is a bit bigger than original patch I have uploaded it on my server. It is available at http://adam.pilorz.net/files/tar.php.patch
 [2006-12-20 20:48 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!