mirror of
https://github.com/DarrylNixon/melamine.git
synced 2024-04-22 06:27:20 -07:00
ext2/3 is hard, use find as backup
This commit is contained in:
parent
155b3e2006
commit
068d47703a
2 changed files with 36 additions and 3 deletions
|
@ -12,7 +12,6 @@ async def main(job: argparse.Namespace) -> bool:
|
|||
It is called by the CLI and builds a job queue based on the arguments passed.
|
||||
"""
|
||||
new_paths = set()
|
||||
logger.info(f"job type is {type(job)}")
|
||||
|
||||
# Expand all directories and files, and collect mount point information
|
||||
for path in job.paths:
|
||||
|
@ -28,9 +27,14 @@ async def main(job: argparse.Namespace) -> bool:
|
|||
else:
|
||||
raise TypeError(f"Not a file or directory: {path}")
|
||||
|
||||
# Get hardlinks to subsequently unlink for all files
|
||||
# Try to delete hardlinks based on the filesystem type
|
||||
job.paths = await get_all_hardlinks(new_paths)
|
||||
|
||||
# Just in case, use "find" to delete any remaining hardlinks
|
||||
# from the mount point
|
||||
for path in job.paths:
|
||||
await path.delete_hardlinks_by_inode()
|
||||
|
||||
# Shred all physical files including hardlinks
|
||||
for path in job.paths:
|
||||
if isinstance(path, ShredFile):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue