Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.161.mcz==================== Summary ====================
Name: Files-cmm.161
Author: cmm
Time: 25 July 2016, 3:52:18.391906 pm
UUID: 23aaa0dc-71b3-4585-a06a-25a113d14404
Ancestors: Files-cmm.160
- Soften the change to FileDirectory>>#/ to be more backward compatible, and extend it to DirectoryEntry.
- We have #assureExistence, add #assureAbsence for safely ensuring a directory does not exist without having to write a error-handler.
=============== Diff against Files-cmm.160 ===============
Item was added:
+ ----- Method: DirectoryEntryDirectory>>/ (in category 'access') -----
+ / aString
+ ^ self asFileDirectory / aString!
Item was added:
+ ----- Method: DirectoryEntryDirectory>>assureAbsence (in category 'file operations') -----
+ assureAbsence
+ self asFileDirectory assureAbsence!
Item was added:
+ ----- Method: DirectoryEntryDirectory>>delete (in category 'file operations') -----
+ delete
+ self asFileDirectory recursiveDelete!
Item was changed:
----- Method: FileDirectory>>/ (in category 'path access') -----
/ aString
+ "Answer a FileDirectory on a subdirectory named aString, of the receiver. If there is already a file named aString in the receiver directory, answer its Entry."
+ | dir |
+ dir := FileDirectory on: (self fullNameFor: aString).
+ ^ dir exists
+ ifTrue: [ dir ]
+ ifFalse:
+ [ self
+ entryAt: aString
+ ifAbsent: [ dir ] ]!
- "Answer a FileDirectory on a subdirectory named aString, of the receiver."
- ^ FileDirectory directoryEntryFor: (self fullNameFor: aString)!
Item was added:
+ ----- Method: FileDirectory>>assureAbsence (in category 'file directory') -----
+ assureAbsence
+ self exists ifTrue: [ self recursiveDelete ]!