Skip to content

Instantly share code, notes, and snippets.

@simontopliss
Created October 6, 2018 15:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simontopliss/c4b2432be49fa8af8205d5b4de14998b to your computer and use it in GitHub Desktop.
Save simontopliss/c4b2432be49fa8af8205d5b4de14998b to your computer and use it in GitHub Desktop.
// 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