views:

21

answers:

0

I copy some text files from a server to the NSDocumentDirectory on the iPad. One of the files has a .sql extension. They all store correctly and everything works OK, except there's one puzzling thing: When I delete the application from the iPad (make it wiggle and hit the X), all the existing files get deleted (as I'd expect) except for the file with the .sql extension. I'd expect this file to go away too, but it doesn't. I am using some CoreData routines, so this may be it, but it was puzzling to me why the whole directory doesn't get hosed when I delete the app. Any ideas?

Hmmm...it seems the file itself does go away -- it's just the directory entry that sticks. if I do

- (void) listTheDirectory
{
    NSError * error;
    NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) 
                       objectAtIndex:0];
    NSArray * filesInDirectory = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:&error];
    for (NSString * oneFile in filesInDirectory)
    {
        NSLog(@"File in Directory %@", oneFile);
    }

}

...the file is displayed. But if I try to get the attributes of onefile it fails, so the file isn't there, just a vagrant directory entry.