"Last Chance" Exclusion Callback
Posted: Wed Sep 20, 2017 12:05 pm
Is there a chance to have a "last chance callback" for excluding a file from compression?
wimlib's extensive callbacks are great, but the file callbacks are only sent during the initial scanning phase, right?
When operating under very limited disk space conditions, such that the WIM file is being built "eating up" space freed from files that are deleted as soon as wimlib finishes compressing them, this becomes a necessity.
As free disk space grows, files which could not be *safely* compressed inside the WIM at the *start* of the process (initial scanning phase) can often be accommodated inside the WIM further along the process.
If such a "last chance exclusion callback" is not possible in wimlib...can the library consumer get "creative" with some tricks?
For example, what if the file is "swapped" at the last minute when I receive your progress callback for the file - would that work, as a hack of sorts?
In other words, all files would be signaled for inclusion during the regular exclusion callback; when the progress callback is received with the file name to compress, if there isn't enough disk room to accommodate the growth in the WIM and the original uncompressed file copy still present during compression; a zero-byte file could be substituted instead manually - a poor man's "last chance exclusion" callback of sorts.
Would this break anything in the WIM or in wimlib, since wimlib probably sets up internal WIM structures well ahead of this phase?
wimlib's extensive callbacks are great, but the file callbacks are only sent during the initial scanning phase, right?
When operating under very limited disk space conditions, such that the WIM file is being built "eating up" space freed from files that are deleted as soon as wimlib finishes compressing them, this becomes a necessity.
As free disk space grows, files which could not be *safely* compressed inside the WIM at the *start* of the process (initial scanning phase) can often be accommodated inside the WIM further along the process.
If such a "last chance exclusion callback" is not possible in wimlib...can the library consumer get "creative" with some tricks?
For example, what if the file is "swapped" at the last minute when I receive your progress callback for the file - would that work, as a hack of sorts?
In other words, all files would be signaled for inclusion during the regular exclusion callback; when the progress callback is received with the file name to compress, if there isn't enough disk room to accommodate the growth in the WIM and the original uncompressed file copy still present during compression; a zero-byte file could be substituted instead manually - a poor man's "last chance exclusion" callback of sorts.
Would this break anything in the WIM or in wimlib, since wimlib probably sets up internal WIM structures well ahead of this phase?