For some reason, fopen gives an error No such file or directory, although I converted the path to the document path.
NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *filePath = [docsPath stringByAppendingPathComponent:filename];
I pass NSString using a method UTF8Stringand open in read only mode with
if ((fh=fopen(filename, "r+b")) == NULL){
perror("fopen");
return -1;
}
When I try to open the file name, the following full path is printed (I deleted the exact values ββfor the name of the actual application name)
/VAR/mobile/Applications/#####//Documents/testImages.pak
Why don't fopen detect the file? I added it to the target and even tried changing the location settings in the file inspector to Relative to GroupandRelative to Project
source
share