The Spotlight module misleadingly updated a files modification date
when the client requested an "kMDItemLastUsedDate" attribute update.
It's questionable whether we're expected at all to map and modify
attributes to filesystem metadata, but my guess is we are.
As a fix, use "kMDItemFSContentChangeDate" attribute instead of
"kMDItemLastUsedDate".
Fixes bug #545.
Changes in 3.1.2
================
* FIX: Option "vol dbpath" was broken in 3.1.1
Changes in 3.1.2
================
* FIX: Option "vol dbpath" was broken in 3.1.1
+* FIX: Spotlight: file modification date, bug #545
Changes in 3.1.1
================
Changes in 3.1.1
================
EC_NEG1_LOG( movecwd(vol, dir) );
}
EC_NEG1_LOG( movecwd(vol, dir) );
}
- if ((sl_time = dalloc_value_for_key(query, "DALLOC_CTX", 0, "DALLOC_CTX", 1, "DALLOC_CTX", 1, "kMDItemLastUsedDate"))) {
+ /*
+ * We're possibly supposed to update attributes in two places: the
+ * database and the filesystem. Due to the lack of documentation
+ * and not yet implemented database updates, we cherry pick attributes
+ * that seems to be candidates for updating filesystem metadata.
+ */
+
+ if ((sl_time = dalloc_value_for_key(query, "DALLOC_CTX", 0, "DALLOC_CTX", 1, "DALLOC_CTX", 1, "kMDItemFSContentChangeDate"))) {
struct utimbuf utimes;
utimes.actime = utimes.modtime = sl_time->tv_sec;
utime(path, &utimes);
struct utimbuf utimes;
utimes.actime = utimes.modtime = sl_time->tv_sec;
utime(path, &utimes);