DirectoryContents.st
changeset 1468 476e360d4aeb
parent 1435 5895158e7491
child 1575 4c4042cd577f
--- a/DirectoryContents.st	Fri Aug 13 15:31:06 2004 +0200
+++ b/DirectoryContents.st	Fri Aug 13 21:29:50 2004 +0200
@@ -577,40 +577,33 @@
 
 updateInfo
     "ensure that the file-info is present"
-
+    
     |mountPoints mountPoint nameString linkName|
 
     info isNil ifTrue:[
         nameString := fileName name.
-        fileName isAbsolute ifFalse:[self halt].
-
+        self assert:[fileName isAbsolute].
         mountPoints := self cachedRemoteMountPoints.
-
-        fileName isSymbolicLink ifTrue:[
-            linkName := fileName linkInfo path.
-        ].
-
-        "/ does the file represent a remote-mounted file
-        linkName isNil ifTrue:[
-            "/ have to check for mountPoint only
-            mountPoint := mountPoints detect:[:mInfo | mInfo mountPointPath = nameString] ifNone:nil.
+        info := fileName linkInfo.
+        (info notNil and:[info isSymbolicLink]) ifTrue:[
+            "have to check for both link and link target"
+            linkName := info path.
+            mountPoint := mountPoints 
+                        detect:[:mInfo | |p|
+                            p := mInfo mountPointPath.
+                            ((linkName startsWith:p) and:[ linkName startsWith:(p , '/') ])
+                        ]
+                        ifNone:nil.
+            info := fileName info.  "get the info of the link target"
         ] ifFalse:[
-            "/ have to check for mountPoint AND links INTO the mounted fileSystem
+            "have to check for mountPoint only"
             mountPoint := mountPoints 
-                            detect:
-                                [:mInfo | 
-                                    |p|
-
-                                    p := mInfo mountPointPath.
-                                    ((linkName startsWith:p) and:[ linkName startsWith:(p,'/') ])
-                                ]
-                            ifNone:nil. 
+                        detect:[:mInfo | mInfo mountPointPath = nameString ]
+                        ifNone:nil.
         ].
-
         (mountPoint notNil) ifTrue:[
             info := #remoteDirectory.
         ] ifFalse:[
-            info := fileName info.
             info isNil ifTrue:[
                 "/ broken symbolic link
                 info := #symbolicLink.
@@ -642,7 +635,7 @@
 !DirectoryContents class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/DirectoryContents.st,v 1.39 2004-03-20 15:41:16 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/DirectoryContents.st,v 1.40 2004-08-13 19:29:50 stefan Exp $'
 ! !
 
 DirectoryContents initialize!