Post

Replies

Boosts

Views

Activity

Reply to FileManager.default.contentsOfDirectory fails with SMB
This is what I tried:     func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {         guard let folderUrl = urls.first else {return}         let startAccessing = folderUrl.startAccessingSecurityScopedResource()         defer { if startAccessing {folderUrl.stopAccessingSecurityScopedResource()}}         var error : NSError? = nil         NSFileCoordinator().coordinate(readingItemAt: folderUrl, error: &error) { (url) in             let rep = (url as NSURL).fileSystemRepresentation             guard let dir = opendir(rep) else {return}             defer { closedir(dir) }             while let ent = readdir(dir) {                 print(String(cString: &ent.pointee.d_name.0))             }         }     } No difference. This works for the folders that worked with the higher level APIs (other SMB servers, iCloud, local files) but the while loop never starts with my DiskStation. It does, however, get past the opendir line with what appears to be a valid handle. Oh, and no, I wouldn't use this as an actual solution either. Thanks.
Nov ’20
Reply to FileManager.default.contentsOfDirectory fails with SMB
Hi, thanks for getting back to me. Bug report filed here - https://feedbackassistant.apple.com/feedback/8902970, number FB8902970. I have tried passing nil to includingPropertiesForKeys, in fact that's how I had it initially before, as a guess, I tried narrowing the information I was asking for. I am unclear as to how to use lower level APIs for accessing the file system on iOS. I would have thought that I'd be prevented from doing this by the app's sandbox. (Unfortunately, Googling this reveals that Google is keen to suggest that MacOS and iOS are the same thing)
Nov ’20
Reply to FileManager.default.contentsOfDirectory fails with SMB
Some updates. I have tried this with a share from my Mac and my Windows PC and it works, it's only not working with my Synology DiskStation. I have full access to this, I can browse and do whatever I like using the Files app. I can open and work with files on it within my app's code, all I can't do is get FileManager to list the contents of a user selected folder.
Nov ’20