The file âglyphsâ couldnât be opened because you donât have permission to view it
我可以从Finder查看,通过打开面板从同一个应用程序访问。。。隐马尔可夫模型。
print ("filename <\(filename)>, \(isDirectory ? "Directory" : "File")")
let urlf = url.appendingPathComponent(filename, isDirectory: isDirectory)
print( "\(urlf.isFileURL ? "this is a file" : "not a file:") \(urlf)" )
此代码的输出为:
filename <glyphs>, Directory
this is a file: file:///Users/lukasz/Documents/ClanTestDesignSpace/masters/ClnNew-BlackUltraExpandedHigh.ufo/glyphs/
URL没问题,我在finder中创建了“copy glyphs as pathname”,并对两者进行了比较:除了最后一个斜杠外,它们完全相同。但不再是目录了
this is a file
.
let fileURLs = try fileManager.contentsOfDirectory(at: urlf, includingPropertiesForKeys: nil)
总是返回错误。
我试图改变
includingPropertiesForKeys: [URLResourceKey.nameKey]
我检查了沙盒(
User Selected File : read/write
). 我还能查些什么?