File::Overwrite - overwrite the contents of a file and optionally unlink it


File-Overwrite documentation  | view source Contained in the File-Overwrite distribution.

Index


NAME

Top

File::Overwrite - overwrite the contents of a file and optionally unlink it

SYNOPSIS

Top

    use File::Overwrite qw(overwrite);

    # haha, now no-one will know I stole it
    overwrite('sekrit_formular.txt');
    unlink('sekrit_formular.txt');

DESCRIPTION

Top

This module provides a few simple functions for overwriting data files. This will protect against the simplest forms of file recovery.

SECURITY

Top

This module makes all kinds of assumptions about your system - how the disks work, how the filesystem works, and so on. Even if it does overwrite the actual disk blocks containing the original data, this will not necessarily protect you against someone with sufficient equipment and/or determination. If you want to stop forensic recovery of the data, don't put it on a computer in the first place. If you have already put it on a computer, I recommend melting all your disks.

FUNCTIONS

Top

All of the following functions can be exported if you wish. However, none are exported by default. All take a filename as their only parameter (any subsequent params are ignored) and die if that file can't be fiddled with. In case of failure, the file may be left fractionally fiddled.

overwrite

Overwrites the file.

Overwrites and unlinks the file.

BUGS

Top

None known. Please report any that you find using http://rt.cpan.org/.

You should be aware, however, that the tests are only rudimentary. There is no portable way of determining whether a file's data really is overwritten so I don't try very hard.

On Win32 you can't delete files that are open. This is a bug in the operating system, not in this module.

FEEDBACK

Top

I like to know who's using my code. All comments, including constructive criticism, are welcome. Please email me.

THANKS TO

Top

Daniel Muey, for reporting some bugs and misfeatures, see http://rt.cpan.org/Public/Bug/Display.html?id=50067.

SEE ALSO

Top

http://www.perlmonks.com/?node_id=525657

AUTHOR, COPYRIGHT and LICENCE

Top

CONSPIRACY

Top

This module is also free-as-in-mason software.


File-Overwrite documentation  | view source Contained in the File-Overwrite distribution.