Skip to main content

PRUNE_REQUEST_FILE

Constant PRUNE_REQUEST_FILE 

Source
pub const PRUNE_REQUEST_FILE: &str = "cache-prune.request";
Expand description

The file in the state directory that asks a running service to prune now.

§Why a file

On a host whose service runs as another account (LocalSystem on Windows, root elsewhere), the cache root belongs to that account, so host cache prune from an ordinary prompt cannot write it – while host cache show, which only reads, works. The service already reads the state directory it shares with the account that installed it, so a request left there is the one channel both sides can use without administrator rights. The file holds an identifier the asking command chose. The service takes the request by deleting the file, which is how the command knows somebody is listening, and answers in PRUNE_RESULT_FILE under the same identifier, which is how it knows the answer is to this request and not to a pass that was already under way.