2016-11-15 15:00
浏览 196


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.

图片转代码服务由CSDN问答提供 功能建议

我正在用Go编写Bittorrent客户端,我想通过将位域写入以下内容来保存下载进度 文件头/元数据。 这使我可以取消下载,并在下次开始下载时从中断的地方重新开始。

但是,我找不到任何允许我写入文件元数据的标准库或第三方库。 我得到的最接近的是打印os.Stat返回的FileInfo结构。 我不确定如何添加/编辑FileInfo结构。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题