diff --git a/ChangeLog b/ChangeLog index 1618e81d7..bb4f90a3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-08-10 Richard Frith-Macdonald + + * Source/NSColorList.m: + * Source/NSSavePanel.m: + * Source/NSFileWrapper.m: + * Source/NSDocumentController.m: + * Tools/GSspell.m: + Use new method for creating intermediate directories rater than + depending on incorrect behavior of the old method. + 2012-08-07 Fred Kiefer * TextConverters/RTF/RTFProducer.m (-_addAttributesString:): diff --git a/Source/NSColorList.m b/Source/NSColorList.m index b24848883..5672f42de 100644 --- a/Source/NSColorList.m +++ b/Source/NSColorList.m @@ -486,7 +486,9 @@ static NSColorList *themeColorList = nil; if (path_is_standard && ([fm fileExistsAtPath: path] == NO)) { if ([fm createDirectoryAtPath: path - attributes: nil]) + withIntermediateDirectories: YES + attributes: nil + error: NULL]) { NSLog (@"Created standard directory %@", path); } diff --git a/Source/NSDocumentController.m b/Source/NSDocumentController.m index 1892c5128..6ad88824c 100644 --- a/Source/NSDocumentController.m +++ b/Source/NSDocumentController.m @@ -1501,14 +1501,24 @@ static NSString *processName = nil; if ([fm fileExistsAtPath: path isDirectory: &isDir] == NO) { - if (![fm createDirectoryAtPath: path attributes: nil]) - return nil; + if (![fm createDirectoryAtPath: path + withIntermediateDirectories: YES + attributes: nil + error: NULL]) + { + return nil; + } } else if (isDir == NO) { - if (![fm removeFileAtPath: path handler: nil] || - ![fm createDirectoryAtPath: path attributes: nil]) - return nil; + if (![fm removeFileAtPath: path handler: nil] + || ![fm createDirectoryAtPath: path + withIntermediateDirectories: YES + attributes: nil + error: NULL]) + { + return nil; + } } } diff --git a/Source/NSFileWrapper.m b/Source/NSFileWrapper.m index a67d3aa4a..971ffd59b 100644 --- a/Source/NSFileWrapper.m +++ b/Source/NSFileWrapper.m @@ -203,7 +203,10 @@ NSEnumerator *enumerator = [_wrapperData keyEnumerator]; NSString *key; - [fm createDirectoryAtPath: path attributes: _fileAttributes]; + [fm createDirectoryAtPath: path + withIntermediateDirectories: YES + attributes: _fileAttributes + error: NULL]; while ((key = (NSString*)[enumerator nextObject])) { NSString *newPath = diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 85666775e..f2670852e 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -1336,7 +1336,10 @@ selectCellWithString: (NSString*)title if (result == NSAlertDefaultReturn) { - if ([_fm createDirectoryAtPath: filename attributes: nil] == NO) + if ([_fm createDirectoryAtPath: filename + withIntermediateDirectories: YES + attributes: nil + error: NULL] == NO) { NSRunAlertPanel(_(@"Save"), _(@"The directory '%@' could not be created."), diff --git a/Tools/GSspell.m b/Tools/GSspell.m index 6d63c8e1c..3f1d2b7fc 100644 --- a/Tools/GSspell.m +++ b/Tools/GSspell.m @@ -137,7 +137,10 @@ } path = [path stringByAppendingPathComponent: @"Resources"]; - if (![fm createDirectoryAtPath: path attributes: nil]) + if (![fm createDirectoryAtPath: path + withIntermediateDirectories: YES + attributes: nil + error: NULL]) { NSLog(@"cannot not create bundle directory %@", path); return NO;