How to detect Time Machine volume?
How to detect Time Machine volume?
- Subject: How to detect Time Machine volume?
- From: Leonardo Borsten <email@hidden>
- Date: Tue, 02 Aug 2011 11:57:37 -0400
Hello,
What is the most reliable way to detect in code if a mounted volume is the Time Machine disk?
Currently I'm using the following code (also to detect a Boot Camp volume):
- (Boolean)isNotSearchable:(NSString *)volumePath
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *timemachine = [volumePath stringByAppendingPathComponent:@"Backups.backupdb"];
NSString *winSystem = [volumePath stringByAppendingPathComponent:@"MSDOS.SYS"];
if ([fm fileExistsAtPath:timemachine]) return YES;
if ([fm fileExistsAtPath:winSystem]) return YES;
return NO;
}
This works fine on my system. Will this code work reliably on my user's systems? Is there a better way?
The same question can apply for iDisk and iCloud, probably.
The reason I need to know is that I have a function using FSCatalogSearch where I definitely don't want to access these type of volumes.
Thanks!
Leonardo Borsten
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden