]> src.bluestatic.org Git - macgdbp.git/blob - Sparkle.framework/Versions/A/Headers/NSFileManager+ExtendedAttributes.h
Use automatic validation of UI items for the toolbar buttons, rather than manually...
[macgdbp.git] / Sparkle.framework / Versions / A / Headers / NSFileManager+ExtendedAttributes.h
1 //
2 // NSFileManager+ExtendedAttributes.h
3 // Sparkle
4 //
5 // Created by Mark Mentovai on 2008-01-22.
6 // Copyright 2008 Mark Mentovai. All rights reserved.
7 //
8
9 #ifndef NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
10 #define NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
11
12 #import <Cocoa/Cocoa.h>
13
14 @interface NSFileManager (MMExtendedAttributes)
15
16 // Wraps the removexattr system call, allowing an AppKit-style NSString* to
17 // be used for the pathname argument. Note that the order of the arguments
18 // has changed from what removexattr accepts, so that code reads more
19 // naturally.
20 //
21 // removexattr is only available on Mac OS X 10.4 ("Tiger") and later. If
22 // built with an SDK that includes removexattr, this method will link against
23 // removexattr directly. When using earlier SDKs, this method will dynamically
24 // look up the removexattr symbol at runtime. If the symbol is not present,
25 // as will be the case when running on 10.3, this method returns -1 and sets
26 // errno to ENOSYS.
27 - (int)removeXAttr:(const char*)name
28 fromFile:(NSString*)file
29 options:(int)options;
30
31 // Removes the directory tree rooted at |root| from the file quarantine.
32 // The quarantine was introduced on Mac OS X 10.5 and is described at:
33 //
34 // http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html
35 //#apple_ref/doc/uid/TP40001369-DontLinkElementID_2
36 //
37 // If |root| is not a directory, then it alone is removed from the quarantine.
38 // Symbolic links, including |root| if it is a symbolic link, will not be
39 // traversed.
40 //
41 // Ordinarily, the quarantine is managed by calling LSSetItemAttribute
42 // to set the kLSItemQuarantineProperties attribute to a dictionary specifying
43 // the quarantine properties to be applied. However, it does not appear to be
44 // possible to remove an item from the quarantine directly through any public
45 // Launch Services calls. Instead, this method takes advantage of the fact
46 // that the quarantine is implemented in part by setting an extended attribute,
47 // "com.apple.quarantine", on affected files. Removing this attribute is
48 // sufficient to remove files from the quarantine.
49 - (void)releaseFromQuarantine:(NSString*)root;
50
51 @end
52
53 #endif