I created a Directory for my application via code. I can write just fine to the new folder, but it is not allowing me to retrieve a listing of documents in the folder. aka contentsOfDirectoryAtPath
This is the error i get when trying to get the contents:
NSCocoaErrorDomain 257 {
NSFilePath = "/var/mobile/Applications/13E92A6C-AB08-4D7F-A19C-D6C66BA2A67C/Documents/Audio";
NSUnderlyingError = Error Domain=NSPOSIXErrorDomain Code=13 "Operation could not be completed. Permission denied";
This is how i set up the folder to be created
Just wondering if someone sees something I missed when setting this new folder up.
I know some of the values are not what they "should" be, I looked at the documentation on the apple site and it did not do too good of a job explaining how to get these values.
This is the error i get when trying to get the contents:
NSCocoaErrorDomain 257 {
NSFilePath = "/var/mobile/Applications/13E92A6C-AB08-4D7F-A19C-D6C66BA2A67C/Documents/Audio";
NSUnderlyingError = Error Domain=NSPOSIXErrorDomain Code=13 "Operation could not be completed. Permission denied";
This is how i set up the folder to be created
Code:
NSMutableDictionary *directory = [[NSMutableDictionary alloc] init];
[directory setValue:[NSNumber numberWithBool:NO] forKey:NSFileAppendOnly];
[directory setValue:0 forKey:NSFileBusy];
[directory setValue:[NSDate date] forKey:NSFileCreationDate];
[directory setValue:@"User" forKey:NSFileOwnerAccountName];
[directory setValue:@"Users" forKey:NSFileGroupOwnerAccountName];
[directory setValue:[NSNumber numberWithInt:122] forKey:NSFileDeviceIdentifier];
[directory setValue:0 forKey:NSFileExtensionHidden];
[directory setValue:[NSNumber numberWithLong:23432] forKey:NSFileGroupOwnerAccountID];
//[directory setValue:[NSNumber numberWithLong:3342] forKey:NSFileHFSCreatorCode];
//[directory setValue:[NSNumber numberWithLong:3423] forKey:NSFileHFSTypeCode];
[directory setValue:[NSNumber numberWithBool:YES] forKey:NSFileImmutable];
[directory setValue:[NSDate date] forKey:NSFileModificationDate];
[directory setValue:[NSNumber numberWithLong:89798] forKey:NSFilePosixPermissions];
[directory setValue:[NSNumber numberWithLong:234] forKey:NSFileReferenceCount];
[directory setValue:NSFileSystemFreeSize forKey:NSFileSize];
[directory setValue:[NSNumber numberWithLong:5] forKey:NSFileSystemFileNumber];
[directory setValue:NSFileTypeDirectory forKey:NSFileType];
[fs createDirectoryAtPath:_documents_folder_audio withIntermediateDirectories:NO attributes:directory error:&err];
Just wondering if someone sees something I missed when setting this new folder up.
I know some of the values are not what they "should" be, I looked at the documentation on the apple site and it did not do too good of a job explaining how to get these values.