Correct some names. NJOutputController should be NJOutputViewController as it doesn...
[enjoyable.git] / Categories / NSFileManager+UniqueNames.h
1 //
2 // NSFileManager+UniqueNames.h
3 // Enjoyable
4 //
5 // Created by Joe Wreschnig on 3/7/13.
6 //
7 //
8
9 #import <Foundation/Foundation.h>
10
11 @interface NSFileManager (UniqueNames)
12
13 - (NSURL *)generateUniqueURLWithBase:(NSURL *)canonical;
14 // Generate a probably-unique URL by trying sequential indices, e.g.
15 // file://Test.txt
16 // file://Test (1).txt
17 // file://Test (2).txt
18 // and so on.
19 //
20 // The URL is only probably unique. It is subject to the usual
21 // race conditions associated with generating a filename before
22 // actually opening it. It also does not check remote resources,
23 // as it operates synchronously. Finally, it gives up after 10,000
24 // indices.
25
26 @end