|
From: | L Zee |
Subject: | GNUStep parsing OSX binary plist changed? |
Date: | Thu, 28 Jan 2010 01:30:19 +0000 |
Hi, I recently discovered that a one of my GNUStep programs that parses Safari History.plist files can't parse the files in new versions of safari. As a test ,when I compile and run the following code on OSX using a plist file, it tells me the "plist class" of the plist is "Detected format as NSCFDictionary". When I run the same code compiled on GNUStep that's bundled with ubuntu 9.04, using the same plist file, it tells me the "plist class" is "Detected format as GSCBufferString" and the program aborts. Any ideas on how I can continue to parse these files using GNUstep? Thanks ---------------------------------- #include <Foundation/Foundation.h> // MAIN int main (int argc, const char * argv[]) { // Defs. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; id dict_val; plistData = [NSData dataWithContentsOfFile: [NSString stringWithCString: argv[1]]]; plist = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListMutableContainers format:&format errorDescription:&error]; NSLog(@"%@",plist); NSLog(@"Detected format as %@", [plist class],plist) ; dict_val = [plist objectForKey: @"WebHistoryDates"]; NSLog(@"%@",dict_val); [pool release]; return 0; } Hotmail: Powerful Free email with security by Microsoft. Get it now. |
[Prev in Thread] | Current Thread | [Next in Thread] |