]>
src.bluestatic.org Git - macgdbp.git/blob - Sparkle.framework/Versions/A/Headers/NSFileManager+ExtendedAttributes.h
2 // NSFileManager+ExtendedAttributes.h
5 // Created by Mark Mentovai on 2008-01-22.
6 // Copyright 2008 Mark Mentovai. All rights reserved.
9 #ifndef NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
10 #define NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
12 #import <Cocoa/Cocoa.h>
14 @interface
NSFileManager (MMExtendedAttributes
)
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
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
27 - (int)removeXAttr
:(const char*)name
28 fromFile
:(NSString
*)file
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:
34 // http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html
35 //#apple_ref/doc/uid/TP40001369-DontLinkElementID_2
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
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
;