mholt/archiver

Add a fs that reads converts achiveFS to a seekable version

開放

#342 建立於 2022年8月15日

 (2 則留言) (1 個反應) (0 位負責人)Go (393 個分叉)github user discovery
feature requesthelp wanted

倉庫指標

星標
 (4,378 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

What would you like to have changed?

A similar implementation like tarfs or zipfs is appreciated.

Why is this feature a useful, necessary, and/or important addition to this project?

For performance and intuitivity. Current implementation of archiveFs is a glorified extract operation that tries to extract the file from the reader. Also due to the different arcive layout, some file may be at end the of archive. Every time a file is requested the process repeats which is bad for performance.

an FS.fs can be used in http.Filesystem, however because of archiveFs is implemented, file object can't be seeked, which means when golang http can't figure out content-type from file name or client requested range seek will fail, leading to error.

What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?

In cloudreve, registering a mime type is all that's needed.

Please link to any relevant issues, pull requests, or other discussions.

Performance issues, seek error, cloudreve ttf can't be recognized without seeking on windows.

There is a hack for tar, but I doubt you are willing to do this for tar, rar or zip etc.

貢獻者指南