
Classify files the way the check modules do
Source:R/archive-zenodo-upload.R
dot-zenodo_classify.Rdrepo_check(), code_check() and data_check() all classify a
repository's files with data_classify_files(), into six categories:
data, code, materials, documentation, output, and unknown.
Splitting an upload calls the very same function, so a file cannot end up in
one category when it is checked and another when it is archived.
Details
That function reads names and paths only, never file contents, in three
steps: a format-locked extension (a .sav is code, a .csv is data), then
a category word used as a whole token in the path (Materials/,
results.docx), then a crosswalk through the coarse file type, where
image, audio, video, 3D, exec, config and font all become
materials. Because nothing is opened, classifying costs no time even for a
folder of very large files.