-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contribution? #107
Comments
Sounds great! Just open a Pull Request, I'll review your code and if all is well I'll commit it. If you're new to Github PRs the whole process will involve a bit of a learning curve, but if that's the case you should be able to find some good tutorials out there. |
Unfortunately I have my hands full with learning curves at the moment. It's just a small amount of code so I'll just post here and hopefully someone else can bake it in for the common good. - (NSString*) resourceDirectory {
NSBundle* myBundle = [NSBundle mainBundle];
return [myBundle resourcePath];
}
- (NSString*) homeDirectory {
return NSHomeDirectory();
}
- (BOOL) createDirectory:(NSString*)path {
NSFileManager *fileManager= [NSFileManager defaultManager];
NSError *error = nil;
if(![fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]) {
NSLog(@"Failed to create directory \"%@\". Error: %@", path, error);
return false;
}
return true;
}
- (void) delete:(NSString*)path {
NSFileManager *fileManager= [NSFileManager defaultManager];
[fileManager removeItemAtPath:path error:nil];
} |
Thanks for this! |
Well, turns out that a couple of things I added (home and resources directories) are already covered as properties of the MagGap object, which I hadn't found before. My createDirectory and delete are still useful though. |
I have added these functions to the File interface and I'm willing to contribute them. How is that done?
The text was updated successfully, but these errors were encountered: