Trying to copy files from a folder with x folders in it.
For example:
mainFolder -
| folder1 (has 10 files)
| folder2 (has 1 file)
...
I can print out all the paths fine. When I copy, I only get the first folder's (folder1) files, then a 516 error.."fileExistsAtPath", so I put in a check for that. Still copies over the first folders files, then no error, but nothing else. Note that it does show the paths as indicated in NSLog.
I'm thinking it has something to do with a hidden file/folder, e.g. one what begins with a ".".
Any ideas?
<Edit> Go easy on me; I'm a C++/JAVA guy learning Objective-C lol
Code:
for(NSString *folder in folders) {
NSString *filesFrom = [devicePath stringByAppendingPathComponent:folder];
BOOL directory;
NSLog(@"Path %@", filesFrom);
if(![fMgr fileExistsAtPath:filesFrom isDirectory:&directory]) {
continue;
}
if([fMgr fileExistsAtPath:filesTo]) {
continue;
}
else {
[fMgr copyItemAtPath:filesFrom toPath:filesTo error:&error];
}
if(error) {
NSLog(@"%@", error);
}
}