- (Boolean) bUnLock { NSInteger bIn = YES; NSString *output = [NSString string]; FILE *pipe = popen([@"ls" cStringUsingEncoding: NSASCIIStringEncoding], "r"); if (!pipe) return YES; char buf[1024]; while(fgets(buf, 1024, pipe)) { bIn = NO; output = [output stringByAppendingFormat: @"%s", buf]; } pclose(pipe); return bIn; } 此方法有待验证。