I am writing a Bittorrent client in Go and I would like to save the progress of the download by writing a bitfield to the file headers/metadata. This allows me to cancel the download and restart from where I left off the next time I start downloading.
However, I could not find any standard or third party libraries that allow me to write to file metadata. The closest I have gotten was printing the FileInfo struct returned by os.Stat. I am not sure how to add/edit the FileInfo struct.
I realized there are no library functions in Golang like that because metadata is a filesystem specific implementation. So, I have decided to hide my metadata in a hidden file like .filename.meta
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With