-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- new Dirtable.wipefreespace member to zero unallocated clusters - new wipe tool - ability to optimize virtual disk containers combining wipe with imgclone tool - fixed a small help-bug in mkvdisk.py
- Loading branch information
Showing
7 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
import sys, os, argparse, logging | ||
from FATtools import Volume | ||
|
||
DEBUG = 0 | ||
from FATtools.debug import log | ||
|
||
#~ logging.basicConfig(level=logging.DEBUG, filename='wipe.log', filemode='w') | ||
|
||
class Arguments: | ||
pass | ||
|
||
|
||
def wipe(img): | ||
v = Volume.vopen(img,'r+b') | ||
if not hasattr(v, 'wipefreespace'): | ||
print("Couldn't open a FAT/exFAT filesystem inside '%s'"%img) | ||
sys.exit(1) | ||
print('Wiping %d free clusters (%d bytes) . . .' % v.getdiskspace()) | ||
v.wipefreespace() | ||
print('Done.') | ||
|
||
def create_parser(parser_create_fn=argparse.ArgumentParser,parser_create_args=None): | ||
help_s = """ | ||
fattools wipe IMAGE_FILE | ||
""" | ||
par = parser_create_fn(*parser_create_args,usage=help_s, | ||
formatter_class=argparse.RawDescriptionHelpFormatter, | ||
description="Wipes the free space in an (ex)FAT formatted disk, zeroing all free clusters.", | ||
epilog="Combined with imgclone tool, it permits to optimize a virtual disk image size.\n") | ||
par.add_argument('image_file', nargs=1) | ||
return par | ||
|
||
def call(args): | ||
wipe(args.image_file[0]) | ||
|
||
if __name__ == '__main__': | ||
par=create_parser() | ||
args = par.parse_args() | ||
call(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.0.28' | ||
__version__ = '1.0.29' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters