undo-download: does not remove files, but removes sole refs
bertsky opened this issue · comments
core/ocrd/ocrd/cli/workspace.py
Line 472 in 742906e
This implementation is strange:
- if it encounters a file ref without any URL FLocat (i.e. if the file was created by OCR-D itself as output of a processor), then it will still just remove the ref (and thus destroy the information).
- it never actually removes files from the filesystem (even the ones it unreferenced).
How is this supposed to be used then?
if it encounters a file ref without any URL FLocat (i.e. if the file was created by OCR-D itself as output of a processor), then it will still just remove the ref (and thus destroy the information).
That's an oversight, the local FLocat should not be removed if it is the only ref.
On the same note, the behavior of (bulk-)add
is currently also wonky, creating both URL
and FILE
mets:FLocats
.
it never actually removes files from the filesystem (even the ones it unreferenced).
It just didn't occur to me, I wanted to make the downloads reversible on the METS level but we can add the option to actually remove the files.
It just didn't occur to me, I wanted to make the downloads reversible on the METS level but we can add the option to actually remove the files.
Then for the sake of consistency I recommend doing the opposite: making the filesystem action the default and adding an option -k, --keep-file Do not delete file from file system
.
It just didn't occur to me, I wanted to make the downloads reversible on the METS level but we can add the option to actually remove the files.
Then for the sake of consistency I recommend doing the opposite: making the filesystem action the default and adding an option
-k, --keep-file Do not delete file from file system
.
Alternatively, we could implement a generic-purpose command clean
, complementary to prune-files and undo-download: removing files in the workspace which are not referenced in the METS.