Update of /cvsroot/bobs/bobs/inc/templates
In directory sc8-pr-cvs1:/tmp/cvs-serv18968
Modified Files:
backup_create_databases.php
Log Message:
fixed bug with stats. Did not stat properly on symbolic links
Index: backup_create_databases.php
===================================================================
RCS file: /cvsroot/bobs/bobs/inc/templates/backup_create_databases.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- backup_create_databases.php 8 Jan 2003 15:55:50 -0000 1.2
+++ backup_create_databases.php 4 Jan 2004 15:17:38 -0000 1.3
@@ -45,15 +45,22 @@
// insert name
$num = $range+1;
dba_insert ($num, $file['name'], $this->id);
+
+ // changed to let it also work for symbolic links
+ $arrStat = lstat($file['dir'] . '/' . $file['name']);
+
// insert date if it is not part of the filename (it is in incremental files)
if ( $date == "current" ) {
$num = $range+2;
- $stamp = filemtime ($file['dir'] . '/' . $file['name']);
+ // date of last modification is at position 10
+ $stamp = $arrStat[10];
+
$filedate = sprintf(".%04d.%03d", date("Y", $stamp), date("z", $stamp));
dba_insert ($num, $filedate, $this->id);
}
// insert filesize
- $filesize = filesize($file['dir'] . '/' . $file['name']);
+ // filesize in bytes is at position 8
+ $filesize = $arrStat[8];
$num = $range+3;
dba_insert ($num, $filesize, $this->id);
//increment the range
|