HierarchicalFileList.st
changeset 2583 02797ea5589d
parent 2536 c38f8c10dda3
child 2654 d6925414a41d
--- a/HierarchicalFileList.st	Mon Nov 17 14:18:32 2003 +0100
+++ b/HierarchicalFileList.st	Tue Nov 18 20:12:45 2003 +0100
@@ -941,16 +941,26 @@
 !HierarchicalFileList::Directory methodsFor:'fetching'!
 
 basicFetchIndicator
-    |hasChildren|
+    |linkName fileName hasChildren|
 
-    hasChildren := DirectoryContents directoryNamed:(self fileName) detect:(self model matchBlock).
+    fileName := self fileName.
+    linkName := fileName name.
+    fileName isSymbolicLink ifTrue:[
+        linkName := fileName linkInfo path.
+    ].
+    (OperatingSystem mountPoints contains:[:mp | mp mountPointPath = linkName]) ifTrue:[
+        "do not follow mounted directories automatically (could be an NFS hardlink)"
+        ^ self.
+    ].
+
+    hasChildren := DirectoryContents directoryNamed:fileName detect:(self model matchBlock).
     self knownToHaveChildren:hasChildren.
-    children notNil ifTrue:[self halt].
+    children notNil ifTrue:[self halt:'oops'].
 
     children isNil ifTrue:[
         "setup modification time to suppress monitorCycle
         "
-        modificationTime := self fileName modificationTime.
+        modificationTime := fileName modificationTime.
     ].
 !
 
@@ -1130,9 +1140,14 @@
     "run monitoring cycle
         !!!!!!!! called by the HierarchicalList only !!!!!!!!
     "
-    |unusedDict addedItems mergedList size modifyTime model timeChanged|
+    |fileName unusedDict addedItems mergedList size modifyTime model timeChanged|
 
-    modifyTime := self fileName modificationTime.
+    fileName := self fileName.
+    fileName isSymbolicLink ifTrue:[
+        modifyTime := fileName linkInfo modificationTime.
+    ] ifFalse:[
+        modifyTime := fileName modificationTime.
+    ].
     modifyTime isNil ifTrue:[^ self].
 
     timeChanged := (modificationTime isNil or:[modifyTime ~= modificationTime]).
@@ -1144,7 +1159,7 @@
         ].
     ].
 
-    DirectoryContents flushCachedDirectoryFor:(self fileName).
+    DirectoryContents flushCachedDirectoryFor:fileName.
     isExpanded ifFalse:[
         timeChanged ifTrue:[
             children := nil.
@@ -1237,7 +1252,7 @@
 !HierarchicalFileList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalFileList.st,v 1.49 2003-07-09 16:36:46 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalFileList.st,v 1.50 2003-11-18 19:12:45 cg Exp $'
 ! !
 
 HierarchicalFileList::Directory initialize!