Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-07-21 03:27:50


Author: danieljames
Date: 2008-07-21 03:27:50 EDT (Mon, 21 Jul 2008)
New Revision: 47648
URL: http://svn.boost.org/trac/boost/changeset/47648

Log:
Slightly more meaningful error when something goes wrong extracting a raw file.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 16 +++++++++++-----
   1 files changed, 11 insertions(+), 5 deletions(-)

Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2008-07-21 03:27:50 EDT (Mon, 21 Jul 2008)
@@ -53,7 +53,7 @@
             $this->file_ = $archive_file_prefix . $this->key_;
         }
         $this->archive_ = str_replace('\\','/', $archive_dir . '/' . $this->version_ . '.zip');
-
+
         foreach ($info_map as $i)
         {
             if (preg_match($i[1],$this->key_))
@@ -137,10 +137,16 @@
         ## header('Content-Disposition: attachment; filename="downloaded.pdf"');
         $file_handle = popen($unzip,'rb');
         fpassthru($file_handle);
- if(pclose($file_handle) != 0) {
- // TODO: Maybe I should buffer the file so that I can return a
- // proper 404 error.
- echo "File not found.";
+ $exit_status = pclose($file_handle);
+ if($exit_status != 0) {
+ if($exit_status == 9) {
+ echo "File not found.";
+ }
+ else {
+ echo "Error extracting file: $exit_status";
+ echo "<br>\n";
+ echo "<code>".htmlentities($unzip)."</code>";
+ }
         }
     }
     


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk