I've tried to open a file directly like fopen("/test.txt","w+")
; it works on the simulator but doesn't work on the iPhone.
Then I've tried this:
NSString *path = [[NSBundle mainBundle] pathForResource: @"GirlName.txt" ofType:nil];
NSLog(path);
fichier = fopen([path cStringUsingEncoding:1],"w+");
if (fichier != NULL)
{
...
}
else
{
perror("error ");
}
I receive in console Permission denied:
2009-07-24 17:17:27.415 Mademoiselle[897:20b]
/var/mobile/Applications/.../....app/GirlName.txt
error : Permission denied
Can you tell me what's wrong?