OSDN Git Service

Added hardlink and symlink support in iUnTAR.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Fri, 24 Sep 2010 03:14:33 +0000 (03:14 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Fri, 24 Sep 2010 03:14:33 +0000 (03:14 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@560 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/function.php
inc/versioninfo.php

index 6275789..f0c5f94 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: function.php - Last Update: 09/23/2010 SVN 559 - Author: cooldude2k $
+    $FileInfo: function.php - Last Update: 09/23/2010 SVN 560 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="function.php"||$File3Name=="/function.php") {
@@ -65,7 +65,7 @@ $REFERERurl = null;
 function output_error($message, $level=E_USER_ERROR) {
     $caller = next(debug_backtrace());
     trigger_error($message.' in <strong>'.$caller['function'].'</strong> called from <strong>'.$caller['file'].'</strong> on line <strong>'.$caller['line'].'</strong>'."\n<br />error handler", $level); }
-// PHP iUnTAR Version 2.9
+// PHP iUnTAR Version 3.0
 function untar($tarfile,$outdir="./",$chmod=null) {
 $TarSize = filesize($tarfile);
 $TarSizeEnd = $TarSize - 1024;
@@ -89,6 +89,10 @@ while (ftell($thandle)<$TarSizeEnd) {
        fseek($thandle,255,SEEK_CUR);
        if($FileType=="0") {
                $FileContent = fread($thandle,$FileSize); }
+       if($FileType=="1") {
+               $FileContent = null; }
+       if($FileType=="2") {
+               $FileContent = null; }
        if($FileType=="5") {
                $FileContent = null; }
        if($FileType=="0") {
@@ -96,6 +100,10 @@ while (ftell($thandle)<$TarSizeEnd) {
                fwrite($subhandle,$FileContent,$FileSize);
                fclose($subhandle); 
                chmod($FileName,$FileCHMOD); }
+       if($FileType=="1") {
+               link($FileName,$LinkedFile); }
+       if($FileType=="2") {
+               symlink($LinkedFile,$FileName); }
        if($FileType=="5") {
                mkdir($FileName,$FileCHMOD); }
        //touch($FileName,$LastEdit);
index 93c71ac..3ca65b4 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 09/23/2010 SVN 559 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 09/23/2010 SVN 560 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,7 +27,7 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 4; $VER1[2] = 1; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 559; $RName = "iDB"; $SFName = "IntDB";
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 560; $RName = "iDB"; $SFName = "IntDB";
 $SVNDay[0] = 09; $SVNDay[1] = 23; $SVNDay[2] = 2010; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false);
 $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true);