#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Tue, 12 Feb 2019 12:57:55 +0100
changeset 23721 2be26425bf83
parent 23720 bff9abbdd133
child 23722 f3a464afa0b7
#BUGFIX by stefan class: Win32OperatingSystem class removed: #setNormal: comment/format in: #clearHidden: #setTemporary: changed: #setHidden: category of: #clearHidden: #setHidden: #setTemporary:
Win32OperatingSystem.st
--- a/Win32OperatingSystem.st	Tue Feb 12 12:57:21 2019 +0100
+++ b/Win32OperatingSystem.st	Tue Feb 12 12:57:55 2019 +0100
@@ -5685,6 +5685,47 @@
    "
 ! !
 
+!Win32OperatingSystem class methodsFor:'file attribute setting'!
+
+clearHidden:aPathName
+    "set the hidden attribute; Return true if the operation succeeded"
+
+    |attr|
+
+    attr := self primGetFileAttributes:aPathName.
+    ^ (attr bitTest:FILE_ATTRIBUTE_HIDDEN) not      "already unset"
+      or:[self primSetFileAttributes:aPathName to:(attr bitClear:FILE_ATTRIBUTE_HIDDEN)].
+
+    "Created: / 29-07-2010 / 11:31:55 / sr"
+    "Modified: / 12-02-2019 / 12:48:51 / Stefan Vogel"
+!
+
+setHidden:aPathName
+    "set the hidden attribute. Return true if the operation succeeded"
+
+    |attr|
+
+    attr := self primGetFileAttributes:aPathName.
+    ^ (attr bitTest:FILE_ATTRIBUTE_HIDDEN)  "already set"
+      or:[self primSetFileAttributes:aPathName to:(attr bitOr:FILE_ATTRIBUTE_HIDDEN)].
+
+    "Modified: / 29-07-2010 / 11:32:26 / sr"
+    "Modified: / 12-02-2019 / 12:46:59 / Stefan Vogel"
+!
+
+setTemporary:aPathName
+    "set the temporary attribute of aPathName.
+     Answer true on success."
+
+    |attr|
+
+    attr := self primGetFileAttributes:aPathName.
+    ^ (attr bitTest:FILE_ATTRIBUTE_TEMPORARY)  "already set"
+      or:[self primSetFileAttributes:aPathName to:(attr bitOr:FILE_ATTRIBUTE_TEMPORARY)].
+
+    "Modified: / 12-02-2019 / 12:49:29 / Stefan Vogel"
+! !
+
 !Win32OperatingSystem class methodsFor:'file dialogs'!
 
 commDlgExtendedError
@@ -5762,20 +5803,6 @@
     ^ false
 !
 
-clearHidden:aPathName
-    "set the hidden attribute; Return true if the operation succeeded"
-
-    |attr|
-
-    attr := self primGetFileAttributes:aPathName.
-    (attr bitTest:FILE_ATTRIBUTE_HIDDEN ) ifTrue:[
-	^ self primSetFileAttributes:aPathName to:(attr bitClear:2).
-    ].
-    ^ true
-
-    "Created: / 29-07-2010 / 11:31:55 / sr"
-!
-
 compressPath:pathName
     "return the pathName compressed - that is, remove all ..-entries
      and . entries. This does not always (in case of symbolic links)
@@ -7123,45 +7150,6 @@
     "
 !
 
-setHidden:aPathName
-    "set the hidden attribute. Return true if the operation succeeded"
-
-    |attr|
-
-    attr := self primGetFileAttributes:aPathName.
-    (attr bitTest:FILE_ATTRIBUTE_HIDDEN ) ifFalse:[
-	^ self primSetFileAttributes:aPathName to:(attr bitOr:2).
-    ].
-    ^ true  "/ aready set
-
-    "Modified: / 29-07-2010 / 11:32:26 / sr"
-!
-
-setNormal:aPathName
-    " sets all file attributes to the normal state
-      e.g. set the hidden attribute to false (unhidden)"
-
-    |attr|
-
-    attr := self primGetFileAttributes:aPathName.
-    (attr bitTest:FILE_ATTRIBUTE_NORMAL ) ifFalse:[
-	^ self primSetFileAttributes:aPathName to:(attr bitOr:2).
-    ].
-    ^ true  "/ aready set
-!
-
-setTemporary:aPathName
-    " set the temporary attribute of aPathName"
-
-    |attr|
-
-    attr := self primGetFileAttributes:aPathName.
-    (attr bitTest:FILE_ATTRIBUTE_TEMPORARY ) ifFalse:[
-	^ self primSetFileAttributes:aPathName to:(attr bitOr:2).
-    ].
-    ^ true  "/ aready set
-!
-
 timeOfLastAccess:aPathName
     "return the time, when the file was last accessed.
      For nonexistent files, nil is returned."