
Fetch One File From a Mergin Project Without Cloning It
Source:R/rfp_mergin.R
rfp_mergin_file_get.RdDownload a single file straight from the server. newgraph/hornby_2026 is
327 MB and its .qgs is 2.2 MB, so reading a project file out of a clone
costs about 150x what the task needs.
Arguments
- project
Character.
namespace/project.- file
Character. Path within the project, e.g.
"hornby_2026.qgs".- path_out
Character. Local destination file (not a directory). Parent directories are created.
- version
Character.
"vN", orNULL(default) for HEAD.- overwrite
Logical. Replace
path_outif it exists. DefaultFALSE- a fetched.qgslanding on top of a live project file is the expensive mistake this guards.
What is verified
The file's checksum, against what the server reported for that version - not just that something arrived. The download reads in chunks and treats a short read as end-of-file, so a truncated transfer produces a plausible-looking file rather than an error. Checking bytes on disk is the pattern this subsystem already uses in place of trusting an exit code (#60); the checksum is that, one step stronger, and it is free because the file listing already carries it.
See also
Other mergin:
rfp_mergin_conflicts(),
rfp_mergin_files(),
rfp_mergin_list(),
rfp_mergin_workspaces()