The ES_EVENT_TYPE_AUTH_CREATE
event can be fired either for a regular file or for a directory. Currently there is no such kind of information in the event structure. Is there any way to find out what exactly the kind of the object is being created right in the ES_EVENT_TYPE_AUTH_CREATE
handler?
Thanks in advance, Aleksandr Skobelev
There’s two cases here:
-
If
destination_type
isES_DESTINATION_TYPE_EXISTING_FILE
, you get the fullstruct stat
information indestination.existing_file.stat
. That includes thest_mode
field. -
If
destination_type
isES_DESTINATION_TYPE_NEW_PATH
, you get the mode indestination.new_path.mode
.
Either way, you should be able to extract the type of file system object from the mode using S_ISDIR
, S_ISREG
, and so on. Is that not working in the new path case?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"