Hello,
In my cocoa application ,I m trying to track all filesystem changes like copy, create and renaming or deletion of file and folder. I am getting the notification through the code shown below but the path of the file/folder is coming as "/.vol/234881026/688946". Now my problem is how to get the path in proper strings like ...i do not know how these numbers can be converted.
What can be done?
Thanks,
Ruhi.
In my cocoa application ,I m trying to track all filesystem changes like copy, create and renaming or deletion of file and folder. I am getting the notification through the code shown below but the path of the file/folder is coming as "/.vol/234881026/688946". Now my problem is how to get the path in proper strings like ...i do not know how these numbers can be converted.
What can be done?
Code:
-(id)init
{
[super init];
if(self!=nil)
{
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(trackNotifications:)
name:nil object:nil];
}
return self;
}
- (void) trackNotifications: (NSNotification *) notification
{
NSLog(@"notification");
id nname = [notification name];
nobj = [notification object];
if(nobj != nil)
{
NSLog(@"object == %@", nobj);
NSString *pt=[[NSFileManager defaultManager] displayNameAtPath:[nobj description] ] ;
pt=[self deviceNameWithMountPath:[nobj description]];
NSLog(@"description == %@",[[nobj description]pathComponents ] );
NSLog(@"path--- %@",pt);
NSLog(@"class == %@", [nobj class]);
}
id ndict = [notification userInfo];
// output accompanying data dictionary
int i;
id keys = [ndict allKeys];
for (i = 1; i < [ndict count]; i++)
{
id key = [keys objectAtIndex:i];
id object = [ndict objectForKey:key];
NSLog(@" key == %@ object == %@", key, object);
}
}
Thanks,
Ruhi.