diff --git a/copyparty/cfg.py b/copyparty/cfg.py index 10e921e8..abfb6c13 100644 --- a/copyparty/cfg.py +++ b/copyparty/cfg.py @@ -116,6 +116,7 @@ flagcats = { "hardlink": "does dedup with hardlinks instead of symlinks", "neversymlink": "disables symlink fallback; full copy instead", "copydupes": "disables dedup, always saves full copies of dupes", + "sparse": "force use of sparse files, mainly for s3-backed storage", "daw": "enable full WebDAV write support (dangerous);\nPUT-operations will now \033[1;31mOVERWRITE\033[0;35m existing files", "nosub": "forces all uploads into the top folder of the vfs", "magic": "enables filetype detection for nameless uploads", diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 9abcfd7a..372d0c6a 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -3956,7 +3956,13 @@ class Up2k(object): if not ANYWIN and sprs and sz > 1024 * 1024: fs = self.fstab.get(pdir) - if fs != "ok": + if fs == "ok": + pass + elif "sparse" in self.flags[job["ptop"]]: + t = "volflag 'sparse' is forcing use of sparse files for uploads to [%s]" + self.log(t % (job["ptop"],)) + relabel = True + else: relabel = True f.seek(1024 * 1024 - 1) f.write(b"e")