#FEATURE by stefan
class: Filename
added: #recursiveMakeDirectoryForEachCreatedDo:
--- a/Filename.st Thu Mar 28 14:53:59 2019 +0100
+++ b/Filename.st Thu Mar 28 14:54:16 2019 +0100
@@ -3830,6 +3830,39 @@
"
!
+recursiveMakeDirectoryForEachCreatedDo:aOneArgBlock
+ "create a directory with the receiver's name and all required intermediate directories.
+ For each created directory evaluate aOneArgBlock with the
+ filename of the created directory.
+
+ Raises an exception if not successful."
+
+ |osErrorHolder|
+
+ osErrorHolder := OperatingSystem
+ recursiveCreateDirectory:(self osNameForDirectory)
+ forEachCreatedDo:aOneArgBlock.
+
+ osErrorHolder notNil ifTrue:[
+ osErrorHolder reportProceedableError:'recursive makedir failed'.
+ ].
+
+ "
+ '/tmp/bla/fasel/murks' asFilename recursiveMakeDirectoryForEachCreatedDo:[:name| Transcript show:'Created: '; showCR:name].
+ '/tmp/bla' asFilename recursiveRemove.
+
+ 'k:\bla\quark' asFilename recursiveMakeDirectory
+ "
+
+ "Created: / 27.11.1995 / 23:36:40 / cg"
+ "Modified: / 5.5.1999 / 13:38:42 / cg"
+
+ "
+ 'C:\windows\bla\xx' asFilename recursiveMakeDirectory
+ 'C:\windows\bla' asFilename recursiveRemoveAll
+ "
+!
+
recursiveMoveDirectoryTo:newName
"recursively copy the directory represented by the receiver, then delete it.
This is different to renaming in case of cross device moves.