safe.srm

Secure file deletion utility.

author:Joe Joyce <joe@decafjoe.com>
copyright:Copyright (c) Joe Joyce and contributors, 2016-2019.
license:BSD
safe.srm.SHRED_ITERATIONS = 35

Value to pass to --iterations argument of shred.

Type:int:
exception safe.srm.SecureDeleteError(message, stdout, stderr)[source]

Bases: exceptions.Exception

Raised when there is a problem securely deleting a file.

__init__(message, stdout, stderr)[source]

Instantiate the error.

Parameters:
  • message (str) – Short message describing the error
  • stdout (str or None) – Standard output related to the error
  • stderr (str or None) – Standard error related to the error
stderr = None

Standard error associated with the error.

Type:str or None
stdout = None

Standard out associated with the error.

Type:str or None
safe.srm.secure_delete(path)[source]

Securely delete file at path.

Parameters:path (str) – Path of file to delete
Raise:SecureDeleteError if there are no secure deletion utilities found on the machine, or if the secure deletion utility returns a non-zero exit code
Return type:None