Directory symlinks

Cort Tompkins rtompkin@cs.odu.edu
Thu, 14 Jun 2001 10:46:04 -0400


Hello,

Should symlinks to directories work properly?  They were showing up as normal 
files to me.  I made the following changes to Gollem.php and my symlink-
directories now work properly.  I really doubt that this is an ideal (i.e. 
efficient) solution but it works perfectly.  Any thoughts on a better way?

Thanks,
Cort Tompkins

============
--- ./gollem/lib/Gollem.php.orig	Thu Jun 14 10:31:40 2001
+++ ./gollem/lib/Gollem.php	Thu Jun 14 10:34:38 2001
@@ -227,6 +227,7 @@
         $list = @ftp_rawlist($gollem['stream'], $dir)
         $sort = array(SORT_TYPE => 'type', SORT_NAME => 'name', SORT_DATE 
=> 'date', SORT_SIZE => 'size');
         $sort = $sort[$prefs->getValue('sortby')];
+	$cur_dir = ftp_pwd($gollem['stream']);
         
         $files = array('**count' => 0);
         foreach ($list as $line) {
@@ -259,6 +260,11 @@
                         $parts['type'] = strtolower($name[count($name) - 1]);
                     }
                 }
+                if ((preg_match('/^l/', $parts['perms'])) && (ftp_chdir($gollem
['stream'], $parts['name']))) {
+			ftp_chdir($gollem['stream'], $cur_dir);
+			$parts['type'] = '**dir';
+		}
                 if ($parts['type'] == '**dir') {
                     $parts['size'] = -1;
                 } else {