1 #include <objc/runtime.h>
2 #include <Foundation/Foundation.h>
4 @interface MIFileManager
5 + (MIFileManager *) defaultManager;
6 - (NSURL *) destinationOfSymbolicLinkAtURL:(NSURL *)url error:(NSError *)error;
9 static Class $MIFileManager;
11 static NSArray *(*_MIFileManager$urlsForItemsInDirectoryAtURL$ignoringSymlinks$error$)(MIFileManager *self, SEL _cmd, NSURL *url, BOOL ignoring, NSError *error);
13 static NSArray *$MIFileManager$urlsForItemsInDirectoryAtURL$ignoringSymlinks$error$(MIFileManager *self, SEL _cmd, NSURL *url, BOOL ignoring, NSError *error) {
14 MIFileManager *manager(reinterpret_cast<MIFileManager *>([$MIFileManager defaultManager]));
15 if (NSURL *destiny = [manager destinationOfSymbolicLinkAtURL:url error:NULL])
17 return _MIFileManager$urlsForItemsInDirectoryAtURL$ignoringSymlinks$error$(self, _cmd, url, NO, error);
20 __attribute__((__constructor__))
21 static void initialize() {
22 $MIFileManager = objc_getClass("MIFileManager");
23 SEL sel(@selector(urlsForItemsInDirectoryAtURL:ignoringSymlinks:error:));
24 Method method(class_getInstanceMethod($MIFileManager, sel));
25 _MIFileManager$urlsForItemsInDirectoryAtURL$ignoringSymlinks$error$ = reinterpret_cast<NSArray *(*)(MIFileManager *, SEL, NSURL *, BOOL, NSError *)>(method_getImplementation(method));
26 method_setImplementation(method, reinterpret_cast<IMP>(&$MIFileManager$urlsForItemsInDirectoryAtURL$ignoringSymlinks$error$));