Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

空洞/稀疏文件下载支持 #575

Open
lz8773 opened this issue Aug 25, 2021 · 1 comment
Open

空洞/稀疏文件下载支持 #575

lz8773 opened this issue Aug 25, 2021 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@lz8773
Copy link

lz8773 commented Aug 25, 2021

1. 什么是空洞文件?

引用一篇博文:https://banbanpeppa.github.io/2019/08/21/linux/holefile

2. 空洞文件下载时有什么问题?

  • 空洞文件在本机生成时,实际的磁盘占用为文件的真实大小,不包含空洞部分(上面博文中的 4K)
  • 但,经网络下载后的文件,大小会变成逻辑大小(上面博文中的4M),包含空洞部分:
    • 一方面,增加了下载过程中的流量消耗
    • 一方面,增加了下载后的磁盘占用

3. 常用下载工具现状

分别使用curl、dfget、wget、scp、rsync、rsync -S进行尝试:
image
可以看到,通过rsync -S下载的文件,是可以保持真实大小的,它提供了针对稀疏文件的下载优化:
image

4. 需求

蜻蜓是否可以也考虑支持一下空洞文件的下载优化?

@jim3ma
Copy link
Member

jim3ma commented Jun 28, 2022

我最近想了一下改怎么支持的好,空洞文件需要提前将0数据读出来,然后再写文件的时候用 seek 跳过0数据,我觉得针对空洞文件,直接进行压缩是最好的解决方法,这样可以直接解压后就是空洞文件了

@gaius-qi gaius-qi added the good first issue Good for newcomers label Jan 20, 2023
e-ngo pushed a commit to e-ngo/dragonfly that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants