Filename.st
changeset 20252 17b9880f243e
parent 20158 2e4c6347ef0b
child 20293 0f6fb5392f70
--- a/Filename.st	Mon Aug 15 12:50:25 2016 +0200
+++ b/Filename.st	Mon Aug 15 12:50:27 2016 +0200
@@ -3195,7 +3195,7 @@
                 "would be nice to keep the access rights of the original test suite"
                 newName accessRights:self accessRights.
             ] on:OperatingSystem accessDeniedErrorSignal do:[:ex|
-                "ignore the error - may occure when copying to a network drive"
+                "ignore the error - may occur when copying to a network drive"
             ].
         ].
         inStream binary; buffered:false.
@@ -3751,34 +3751,34 @@
 
     inStream := self readStream.
     newName exists ifTrue:[
-	accessRights := newName accessRights.
+        accessRights := newName accessRights.
     ] ifFalse:[
-	accessRights := self accessRights.
+        accessRights := self accessRights.
     ].
 
     [
-	"let the temp filename start with a ~ to make it invisible"
-	tempStream := FileStream newTemporaryIn:newName directory osNameForFile nameTemplate:'~%1_%2'.
-	[
-	    "would be nice to keep the access rights of the original file"
-	    tempStream fileName accessRights:accessRights.
-	] on:OperatingSystem accessDeniedErrorSignal do:[:ex|
-	    "ignore the error - may occure when copying to a network drive"
-	].
-
-	inStream binary; buffered:false.
-	tempStream binary; buffered:false.
-	[
-	    inStream copyToEndInto:tempStream.
-	] ifCurtailed:[
-	    tempStream close.
-	    tempStream fileName remove.
-	    tempStream := nil.
-	].
-	tempStream syncData.
+        "let the temp filename start with a ~ to make it invisible"
+        tempStream := FileStream newTemporaryIn:newName directory osNameForFile nameTemplate:'~%1_%2'.
+        [
+            "would be nice to keep the access rights of the original file"
+            tempStream fileName accessRights:accessRights.
+        ] on:OperatingSystem accessDeniedErrorSignal do:[:ex|
+            "ignore the error - may occur when copying to a network drive"
+        ].
+
+        inStream binary; buffered:false.
+        tempStream binary; buffered:false.
+        [
+            inStream copyToEndInto:tempStream.
+        ] ifCurtailed:[
+            tempStream close.
+            tempStream fileName remove.
+            tempStream := nil.
+        ].
+        tempStream syncData.
     ] ensure:[
-	inStream close.
-	tempStream notNil ifTrue:[tempStream close].
+        inStream close.
+        tempStream notNil ifTrue:[tempStream close].
     ].
     tempStream fileName renameTo:newName.