mirror of
https://github.com/DarrylNixon/melamine.git
synced 2024-04-22 06:27:20 -07:00
Unlink Path object instead of Shred*, oops
This commit is contained in:
parent
dacc4a89c7
commit
67570a4368
1 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ class ShredFile(AsyncObject):
|
||||||
"""Class for tracking each file to be shredded."""
|
"""Class for tracking each file to be shredded."""
|
||||||
|
|
||||||
async def __init__(self, path: Path) -> None:
|
async def __init__(self, path: Path) -> None:
|
||||||
self.absolute_path = path.resolve()
|
self.absolute_path = path.resolve().absolute()
|
||||||
self.byte_size = path.stat().st_size
|
self.byte_size = path.stat().st_size
|
||||||
self.mount_point = find_mount(self.absolute_path)
|
self.mount_point = find_mount(self.absolute_path)
|
||||||
self.fs_handler = await mount_to_fs_handler(self.mount_point)
|
self.fs_handler = await mount_to_fs_handler(self.mount_point)
|
||||||
|
@ -137,7 +137,7 @@ class ShredFile(AsyncObject):
|
||||||
# Remove the file
|
# Remove the file
|
||||||
log_buf = f"[4/4] Unlinking {self.absolute_path}"
|
log_buf = f"[4/4] Unlinking {self.absolute_path}"
|
||||||
if not dryrun:
|
if not dryrun:
|
||||||
await file.unlink()
|
self.absolute_path.unlink()
|
||||||
else:
|
else:
|
||||||
log_buf = "DRY RUN (no changes made) " + log_buf
|
log_buf = "DRY RUN (no changes made) " + log_buf
|
||||||
logger.info(log_buf)
|
logger.info(log_buf)
|
||||||
|
|
Loading…
Reference in a new issue