I stumbled across something … undocumented as of hrev59009. When receiving The Node Monitor notices on watched file nodes (B_WATCH_ATTR | B_WATCH_STAT) I’ve noticed (see what I did there?) that in case of attributes-only changes Haiku also sends an additional B_STAT_CHANGED notice with “fields” message field set to just B_STAT_CHANGE_TIME - all other specific time change flags in “fields” are zero, which doesn’t make much sense. This then trigers a B_STAT_CHANGED case for no good reason - or am I missing something? Is there a use case for this?
Ah thanks! I assumed “stat” times are only for the content and don’t change with attributes - I believe that’s how it was in the BeOS? It kind of made sense considering attributes are more like… adjacent to file data so basically ATTR_CHANGED is all you need for attributes.
EDIT: I’ve just noticed that stat structure has also ctime (not to be confused with crtime) in addition to mtime - so this is what it applies to?
“ctime” is present in POSIX, too. But yes, that’s indeed what CHANGE_TIME refers to; it seems I was mistaken when I said the file’s modification time changes.
IIRC that only applies to large attributes that are implemented like files with their own inode and stat data. Internal attributes will share the stat data of the file itself.