Created
October 6, 2018 15:53
-
-
Save simontopliss/c4b2432be49fa8af8205d5b4de14998b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extend NSWorkspace and add a method to test if the volume is a network mount | |
@implementation NSWorkspace (Extras) | |
- (BOOL)checkForNetworkMountAtPath:(NSString*)path { | |
struct statfs stat; | |
int err = statfs([path fileSystemRepresentation], &stat); | |
if (err == 0) | |
{ | |
return !(stat.f_flags & MNT_LOCAL); | |
} | |
return NO; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment