Filename.st
changeset 19440 10dcec541744
parent 19362 dd6ee6342985
child 19478 1f5aa87f6170
child 19599 04c6b041e116
--- a/Filename.st	Fri Mar 25 16:45:25 2016 +0100
+++ b/Filename.st	Fri Mar 25 16:52:39 2016 +0100
@@ -2036,7 +2036,7 @@
 !
 
 components
-    "return the receivers filename components - that is the name of each directory
+    "return the receiver's filename components - that is the name of each directory
      along the pathName (that DOES include the root directory)"
 
     ^ self species components:self name
@@ -2048,7 +2048,7 @@
 !
 
 makeLegalFilename
-    "convert the receivers name to be a legal filename.
+    "convert the receiver's name to be a legal filename.
      This removes/replaces invalid characters and/or compresses
      the name as required by the OS.
      The implementation may change in the future to be more
@@ -2944,7 +2944,7 @@
 !
 
 basicMakeDirectory
-    "create a directory with the receivers name.
+    "create a directory with the receiver's name.
      Return true if successful, false if not."
 
     ^ OperatingSystem createDirectory:(self osNameForDirectory)
@@ -3036,36 +3036,36 @@
 !
 
 createAsEmptyFile
-    "create an empty file with the receivers name.
+    "create an empty file with the receiver's name.
      Raises an exception if not successful
     (either already existing or creation not possible)"
 
     |writeStream|
 
     self exists ifTrue:[
-	OperatingSystem accessDeniedErrorSignal
-	    raiseRequestWith:self
-	    errorString:(' - file exists: ' , self asString).
-	^ self
+        OperatingSystem accessDeniedErrorSignal
+            raiseRequestWith:self
+            errorString:(' - file exists: ' , self asString).
+        ^ self
     ].
 
     FileStream openErrorSignal handle:[:ex|
-	self fileCreationError:self.
-	^ self
+        self fileCreationError:self.
+        ^ self
     ] do:[
-	writeStream := self newReadWriteStream.
+        writeStream := self newReadWriteStream.
     ].
     writeStream close.
 !
 
 createAsSymbolicLinkTo:linkFilenameString
-    "create a directory with the receivers name.
+    "create a directory with the receiver's name.
      Raises an exception if not successful"
 
     OperatingSystem createSymbolicLinkFrom:linkFilenameString to:self pathName.
 
     "
-	'/tmp/link' asFilename makeSymbolicLinkTo:'bla'
+        '/tmp/link' asFilename makeSymbolicLinkTo:'bla'
     "
 !
 
@@ -3076,17 +3076,17 @@
 !
 
 makeDirectory
-    "create a directory with the receivers name.
+    "create a directory with the receiver's name.
      Raises an exception if not successful"
 
     (self basicMakeDirectory) ifFalse:[
-	"/
-	"/ could have existed before ...
-	"/
-	(self exists and:[self isDirectory]) ifFalse:[
-	    self fileCreationError:self.
-	    ^ false
-	]
+        "/
+        "/ could have existed before ...
+        "/
+        (self exists and:[self isDirectory]) ifFalse:[
+            self fileCreationError:self.
+            ^ false
+        ]
     ].
     ^ true
 
@@ -4776,9 +4776,9 @@
      BAD DESIGN: has side effect on the receiver.
      This method has both a return value and a side effect on the receiver:
        it returns a collection of matching filename objects,
-       and changes the receivers filename-string to the longest common
+       and changes the receiver's filename-string to the longest common
        match.
-     If none matches, the returned collection is empty and the recevier is unchanged.
+     If none matches, the returned collection is empty and the receiver is unchanged.
      If there is only one match, the size of the returned collection is exactly 1,
      containing the fully expanded filename and the receivers name is changed to it."
 
@@ -5202,7 +5202,7 @@
 physicalFilename
     "return the fileName representing the physical file as represented by the receiver,
      If the receiver represents a symbolic link, thats the fileName of the
-     final target. Otherwise, its the receivers pathName itself.
+     final target. Otherwise, its the receiver's pathName itself.
      If any file along the symbolic path does not exist (i.e. is a broken link),
      nil is returned."
 
@@ -5210,7 +5210,7 @@
 
     pathOrNil := self physicalPathName.
     pathOrNil isNil ifTrue:[
-	^ nil
+        ^ nil
     ].
     ^ pathOrNil asFilename
 
@@ -5222,7 +5222,7 @@
 physicalPathName
     "return the full pathname of the physical file represented by the receiver,
      If the receiver represents a symbolic link, thats the fileName of the
-     final target. Otherwise, its the receivers pathName itself.
+     final target. Otherwise, its the receiver's pathName itself.
      If any file along the symbolic path does not exist (i.e. is a broken link),
      nil is returned."
 
@@ -5230,30 +5230,30 @@
 
     info := self linkInfo.
     info isNil ifTrue:[
-	" I do not exist"
-	^ nil.
+        " I do not exist"
+        ^ nil.
     ].
     info isSymbolicLink ifFalse:[
-	^ self pathName
+        ^ self pathName
     ].
 
     t := self.
     [
-	path := info path.
-	path isNil ifTrue:[
-	    "/ cannot happen
-	    ^ nil
-	].
-	path asFilename isAbsolute ifTrue:[
-	    t := path asFilename
-	] ifFalse:[
-	    t := (self species named:t directoryName) construct:path.
-	].
-	info := t linkInfo.
-	info isNil ifTrue:[
-	    "t does not exist"
-	     ^ nil
-	].
+        path := info path.
+        path isNil ifTrue:[
+            "/ cannot happen
+            ^ nil
+        ].
+        path asFilename isAbsolute ifTrue:[
+            t := path asFilename
+        ] ifFalse:[
+            t := (self species named:t directoryName) construct:path.
+        ].
+        info := t linkInfo.
+        info isNil ifTrue:[
+            "t does not exist"
+             ^ nil
+        ].
     ] doWhile:[info isSymbolicLink].
 
     ^ t pathName
@@ -5808,7 +5808,7 @@
 !Filename methodsFor:'suffixes'!
 
 addSuffix:aSuffix
-    "return a new filename for the receivers name with a additional suffix.
+    "return a new filename for the receiver's name with a additional suffix.
      The new suffix is simply appended to the name,
      regardless whether there is already an existing suffix.
      See also #withSuffix:"
@@ -5817,13 +5817,13 @@
 
     prefixName := self name.
     aSuffix isEmptyOrNil ifTrue:[
-	^ self species named:prefixName
+        ^ self species named:prefixName
     ].
 
     ^ self species named:
-	(prefixName
-	 , self species suffixSeparator asString
-	 , aSuffix asString)
+        (prefixName
+         , self species suffixSeparator asString
+         , aSuffix asString)
 
     "
      'abc.st' asFilename addSuffix:nil
@@ -5875,7 +5875,7 @@
 !
 
 nameWithoutSuffix
-    "return the receivers name without the suffix.
+    "return the receiver's name without the suffix.
      If the name has no suffix, the original name is returned."
 
     |nm idx idxFromEnd|
@@ -6002,7 +6002,7 @@
 !
 
 withSuffix:aSuffix
-    "return a new filename for the receivers name with a different suffix.
+    "return a new filename for the receiver's name with a different suffix.
      If the name already has a suffix, the new suffix replaces it;
      otherwise, the new suffix is simply appended to the name."
 
@@ -6010,13 +6010,13 @@
 
     prefixName := self nameWithoutSuffix.
     aSuffix isEmptyOrNil ifTrue:[
-	^ self species named:prefixName
+        ^ self species named:prefixName
     ].
 
     ^ self species named:
-	(prefixName
-	 , self class suffixSeparator asString
-	 , aSuffix asString)
+        (prefixName
+         , self class suffixSeparator asString
+         , aSuffix asString)
 
     "
      'abc.st' asFilename withSuffix:nil
@@ -6048,7 +6048,7 @@
 !
 
 withoutSuffix
-    "return a new filename for the receivers name without the suffix.
+    "return a new filename for the receiver's name without the suffix.
      If the name has no suffix, a filename representing the same file as the receiver is returned."
 
     |n|