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

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] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.