Post

Replies

Boosts

Views

Activity

Comment on Setting URLResourceKey.fileSecurityKey raises error on some systems
Thanks for your help. During my own tests I could never reproduce an error, regardless whether the permissions were successfully set (on my boot drive) or not (on the external exFAT drive). I would just like to avoid attempting to set the permissions if it will result in an error. Do you think checking for ‘.volumeSupportsExtendedSecurityKey’ should be enough? In my case it returns ‘false’ but attempting anyway doesn’t result in an error, but maybe it would avoid errors on other systems?
Apr ’23
Comment on Reading Finder Info ATTR_CMN_FNDRINFO with getattrlistbulk
Thanks for your input. I would also rather use FileManager, but not all file properties I need are available on all macOS versions I'm currently supporting. In particular, the file identifier or inode, URLResourceKey.fileIdentifierKey, was only recently added in macOS 13.3, almost 3 years after I filed the enhancement request with Feedback Assistant. I understand that it would be sufficient to pass one of those structs to readUnaligned. What would be the correct way of importing them?
Apr ’23
Comment on Get executable path from audit token provided by NEFilterDataProvider
Thanks for your help. I forgot to mention that I'm running that code from inside the main app, with the data forwarded from the extension. I'm using SecCodeCopyPath now, but there still seem to be processes that do not return a path, like trustd, rapportd, nsurlsessiond and timed. Is there an explanation for that? Also I don't understand why apps returned a path and executables didn't, if the app sandbox should prevent me from accessing anything on disk.
Mar ’23
Comment on Passing nil to NEFilterDataProvider.apply(_:completionHandler:) causes error and doesn't apply default settings as documented
Thanks. Using an empty rule set and NEFilterActionFilterData is what I need. I had filed FB12039403. Since in the past the engineers asked me to close many bug reports and open a new one just to update the documentation, I now ask at the end of a bug report that if the documentation is wrong, to update it without the need of opening an additional report. I did that here as well.
Mar ’23
Comment on Getting clicked item index in NSPathControl with pathItems instead of pathComponentCells
That was the first workaround I also thought of, but unfortunately each item represents a filename, so they may not be unique. But after your suggestion of setting the url I tried explicitly removing the first item from pathItems (the one for Macintosh HD) and it seems to work. The question then would be if there's a way to create a url only with the provided string components, because I'm not sure if blindly removing the first item is future-proof.
Feb ’23
Comment on Getting clicked item index in NSPathControl with pathItems instead of pathComponentCells
Thanks again. As I show in my answer below, subclassing doesn't work and didSet is only called once on initialization. Perhaps it's just a wrapper of some internal properties. Since I want to display a virtual path it's not easy to simply use URLs. The closest I got to only displaying the parts that I need is using pathControl.url = URL(fileURLWithPath: "asdf/asdf/asdf", relativeTo: URL(fileURLWithPath: "/")), but then Macintosh HD is always shown as the first item.
Feb ’23
Comment on SCNNode.position is sometimes not reflected on screen
Thanks for your suggestion. I tried it with the following modification, since otherwise the implicit animations would collide with my own: SCNTransaction.begin(); SCNTransaction.disableActions = true; SCNTransaction.animationDuration = 0; /* do the transform */; SCNTransaction.commit(); Although it mitigates the issue with my private project, the sample project still doesn't work as expected.
Feb ’23
Comment on Getting clicked item index in NSPathControl with pathItems instead of pathComponentCells
That's the incredible thing: sender.pathItems.firstIndex(of: sender.clickedPathItem!) always returns nil, even if the clicked path item has the same address as the corresponding item in the path items array. Even sender.pathItems.firstIndex(where: { $0.description == sender.clickedPathItem!.description }) returns nil. And when executing that print statement more than once one after the other, each item always has a different address.
Feb ’23