diff --git a/ChangeLog b/ChangeLog index a6352b328..327f60e2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ -2012-09-09 Wolfgang Lux +2012-09-10 Sergii Stoian - * Source/NSPropertyList.m (-storeString): Add missing variable - declaration on big-endian systems. + * Source/NSFileManager.m: + [createDirectoryAtPath:withIntermediateDirectories:attributes:error:]: + Create directories only if it doesn't exist. 2012-09-06 Richard Frith-Macdonald diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index 51419cdf8..b0e415ebb 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -749,8 +749,12 @@ static NSStringEncoding defaultEncoding; while ((path = (NSString *)[paths nextObject]) != nil) { dir = [dir stringByAppendingPathComponent: path]; - result = [self createDirectoryAtPath: dir - attributes: attributes]; + // create directory only if it doesn't exist + if (NO == [self fileExistsAtPath: dir]) + { + result = [self createDirectoryAtPath: dir + attributes: attributes]; + } } } else