FileDirectory.st
changeset 308 f04744ef7b5d
parent 276 3b6d97620494
child 314 7581a5c57224
--- a/FileDirectory.st	Thu Mar 09 11:52:57 1995 +0100
+++ b/FileDirectory.st	Sat Mar 18 06:06:59 1995 +0100
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.15 1995-02-22 01:13:17 claus Exp $
+$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.16 1995-03-18 05:04:18 claus Exp $
 '!
 
 !FileDirectory class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.15 1995-02-22 01:13:17 claus Exp $
+$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.16 1995-03-18 05:04:18 claus Exp $
 "
 !
 
@@ -264,7 +264,7 @@
 getFullPathName
     "make my pathname be a full pathname - i.e. starting at root"
 
-    |aStream command shortPathName fullPathName|
+    |shortPathName|
 
     (pathName = OperatingSystem fileSeparator asString) ifTrue:[
 	lazy := false.
@@ -283,49 +283,14 @@
 
     shortPathName := pathName.
 
-    "some have a convenient function for this ..."
-%{  /* STACK: 16000 */
-#ifdef HAS_REALPATH
-#   include <stdlib.h>
-#   include <sys/param.h>
-
-    char nameBuffer[MAXPATHLEN + 1];
-
-    if (realpath(_stringVal(_INST(pathName)), nameBuffer)) {
-	fullPathName = _MKSTRING(nameBuffer COMMA_CON);
-    }
-#endif
-%}
-.
-    fullPathName notNil ifTrue:[
-	pathName := fullPathName.
-	lazy := false
-    ] ifFalse:[
-	"since there might be symbolic links and other stuff involved,
-	 better trust pwd than removing '..' by ourself
-	 - although this is very slow"
+    pathName := OperatingSystem pathNameOf:pathName.
+    lazy := false.
 
-	command := 'cd ' , pathName , '; pwd'.
-	aStream := PipeStream readingFrom:command.
-	aStream isNil ifFalse:[
-	    (aStream atEnd) ifFalse:[
-		fullPathName := aStream nextLine
-	    ].
-	    aStream close.
-	    fullPathName notNil ifTrue:[
-		pathName := fullPathName.
-		lazy := false
-	    ]
-	] ifTrue:[
-	    self error:('PipeStream for <' , command , '> failed').
-	    "by clearing lazy, we avoid triggering the error again"
-	    lazy := false
-	]
-    ].
-
-    "if it was the current dir, keep name for next query"
+    "
+     if it was the current dir, keep name for next query
+    "
     (shortPathName = '.') ifTrue:[
-	PathOfCurrentDirectory := fullPathName
+	PathOfCurrentDirectory := pathName
     ]
 !