Revision: 7773
http://skim-app.svn.sourceforge.net/skim-app/?rev=7773&view=rev
Author: hofman
Date: 2012-11-02 16:19:12 +0000 (Fri, 02 Nov 2012)
Log Message:
-----------
make sure unique directory is really unique
Modified Paths:
--------------
trunk/NSFileManager_SKExtensions.m
Modified: trunk/NSFileManager_SKExtensions.m
===================================================================
--- trunk/NSFileManager_SKExtensions.m 2012-11-02 14:11:38 UTC (rev 7772)
+++ trunk/NSFileManager_SKExtensions.m 2012-11-02 16:19:12 UTC (rev 7773)
@@ -95,11 +95,14 @@
}
}
- CFUUIDRef uuid = CFUUIDCreate(NULL);
- NSString *tmpDirName = [(NSString *)CFUUIDCreateString(NULL, uuid)
autorelease];
- CFRelease(uuid);
- NSURL *uniqueURL = [chewableItemsDirectoryURL
URLByAppendingPathComponent:tmpDirName];
+ NSURL *uniqueURL = nil;
+ do {
+ CFUUIDRef uuid = CFUUIDCreate(NULL);
+ uniqueURL = [chewableItemsDirectoryURL
URLByAppendingPathComponent:[(NSString *)CFUUIDCreateString(NULL, uuid)
autorelease]];
+ CFRelease(uuid);
+ } while ([self fileExistsAtURL:uniqueURL]);
+
[self createDirectoryAtPath:[uniqueURL path]
withIntermediateDirectories:NO attributes:nil error:NULL];
return uniqueURL;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit