Create directories only if it doesn't exist.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35548 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
stoyan 2012-09-09 21:29:38 +00:00
parent 546d35a421
commit 064c5554f2
2 changed files with 10 additions and 5 deletions

View file

@ -1,7 +1,8 @@
2012-09-09 Wolfgang Lux <wolfgang.lux@gmail.com>
2012-09-10 Sergii Stoian <stoyan255@gmail.com>
* 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 <rfm@gnu.org>

View file

@ -749,10 +749,14 @@ static NSStringEncoding defaultEncoding;
while ((path = (NSString *)[paths nextObject]) != nil)
{
dir = [dir stringByAppendingPathComponent: path];
// create directory only if it doesn't exist
if (NO == [self fileExistsAtPath: dir])
{
result = [self createDirectoryAtPath: dir
attributes: attributes];
}
}
}
else
{
BOOL isDir;