From: Rudi B. <ru...@us...> - 2005-07-07 15:06:23
|
Update of /cvsroot/jawmail/jaw/lib/vfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21543/vfs Modified Files: sql.php Log Message: ... Index: sql.php =================================================================== RCS file: /cvsroot/jawmail/jaw/lib/vfs/sql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sql.php 11 Aug 2004 00:26:32 -0000 1.1 +++ sql.php 7 Jul 2005 15:06:15 -0000 1.2 @@ -209,14 +209,15 @@ if (!$this->is_dir($path) && !$this->is_file($path)) { - $q = sprintf('INSERT INTO %s_metadata (filename, is_dir, owner, mode) ' . - 'VALUES (%s, %s, %s, %s)', + $q = sprintf('INSERT INTO %s_metadata (filename, is_dir, owner, mode, atime) ' . + 'VALUES (%s, %s, %s, %s, %s)', $this->conf['table_prepend'], $this->DB->quoteSmart($path), $this->DB->quoteSmart(1), $this->DB->quoteSmart($JAW->auth->get('uid')), - $this->DB->quoteSmart($mode) + $this->DB->quoteSmart($mode), + time() ); $this->DB->query($q); @@ -249,6 +250,32 @@ } } + function stat($file) { + + if ($this->is_dir($file)) { + return false; + } + + $q = sprintf('SELECT * FROM %s_metadata WHERE filename = %s', + $this->conf['table_prepend'], + $this->DB->quoteSmart($file) + ); + + $q = $this->DB->query($q); + + if ($q->numRows() == 0) { + return false; + } + + $r = $q->fetchRow(); + + return array('atime' => $r['atime'], + 'size' => $r['size'], + 'mode' => $r['mode'], + 'uid' => $r['owner'] + ); + + } function ls($directory, $options = '') { |