Skip to content

Instantly share code, notes, and snippets.

View simontopliss's full-sized avatar

Simon Topliss simontopliss

View GitHub Profile
// 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;