przemoc / metastore

Store and restore metadata from a filesystem.
http://software.przemoc.net/#metastore
GNU General Public License v2.0
171 stars 31 forks source link

Support other attributes #66

Open data-man opened 7 months ago

data-man commented 7 months ago

Thank you, metastore is cool!

I tried add support atime, ctime and size in my branch: https://github.com/data-man/metastore/tree/other_times.

przemoc commented 7 months ago

Thank you for your interest in metastore, all credits go to original author, David.

From metadata perspective I think there is limited value in storing atime or ctime. ctime is also not easy to apply, as you possibly already noticed. I can see why some would want to keep track of size, but size cannot be applied (at least not in non-destructive way if file would need to get smaller).

BTW long is a bad choice for keeping size, it wouldn't fit bigger files on 32-bit systems and some 64-bit systems (ILP32, LLP64). off_t would be better, but you would need to compile program with -D_FILE_OFFSET_BITS=64. Actually you need to compile with this define anyway (unless you're using musl libc), otherwise stat family of functions fail with EOVERFLOW for 2GB+ files.

mrhawkin commented 1 month ago

Thanks for the effort @data-man! I was actually missing the additional time fields. Even if some of theese items are not fully usable to apply back to a filetree as @przemoc mention, they are still useful in situation one wants to lookup the original metadata when data has been moved to s3 or other storage solution that doesnt preserve all this metadata.