#include <kshred.h>
Inherits TQObject.
Signals | |
void | processedSize (TDEIO::filesize_t bytes) |
void | infoMessage (const TQString &message) |
Public Member Functions | |
KShred (TQString fileName) | |
bool | fill1s () |
bool | fill0s () |
bool | fillbyte (unsigned int byte) |
bool | fillrandom () |
bool | fillpattern (unsigned char *pattern, unsigned int size) |
bool | shred () |
Static Public Member Functions | |
static bool | shred (TQString fileName) |
Detailed Description
- Deprecated:
- Erase a file in a way that makes recovery impossible – well, no guarentee of that, but at least as difficult as reasonably possible.
For this, KShred write several times over the existing file, using different patterns, before deleting it.
Constructor & Destructor Documentation
◆ KShred()
KShred::KShred | ( | TQString | fileName | ) |
Initialize the class using the name of the file to 'shred'.
- Parameters
-
fileName fully qualified name of the file to shred.
Definition at line 31 of file kshred.cpp.
Member Function Documentation
◆ fill0s()
bool KShred::fill0s | ( | ) |
Writes all 0's over the entire file and flushes the file buffers.
- Returns
- true on success, false on error (invalid filename or write error)
Definition at line 75 of file kshred.cpp.
◆ fill1s()
bool KShred::fill1s | ( | ) |
Writes all 1's over the entire file and flushes the file buffers.
- Returns
- true on success, false on error (invalid filename or write error)
Definition at line 68 of file kshred.cpp.
◆ fillbyte()
bool KShred::fillbyte | ( | unsigned int | byte | ) |
Writes the specified byte over the entire file and flushes the file buffers.
- Parameters
-
byte the value to write over every byte of the file
- Returns
- true on success, false on error (invalid filename or write error)
Definition at line 82 of file kshred.cpp.
◆ fillpattern()
bool KShred::fillpattern | ( | unsigned char * | pattern, |
unsigned int | size | ||
) |
Writes the specified byte array over the entire file and flushes the file buffers.
- Parameters
-
pattern the value to write over the entire file size the length of the 'pattern' byte array
- Returns
- true on success, false on error (invalid filename or write error)
Definition at line 103 of file kshred.cpp.
◆ fillrandom()
bool KShred::fillrandom | ( | ) |
Writes random bites over the entire file and flushes the file buffers.
- Returns
- true on success, false on error (invalid filename or write error)
Definition at line 122 of file kshred.cpp.
◆ infoMessage
|
signal |
Shows a message in the progress dialog
- Parameters
-
message the message to display
◆ processedSize
|
signal |
Shows progress of the shredding.
- Parameters
-
bytes the number of bytes written to the file
◆ shred() [1/2]
bool KShred::shred | ( | ) |
Shreds a file by writing a series of values over it (uses fill0s, then fill1s, then fillrandom, then fillbyte with 0101..., then fillbyte with 1010....
- Returns
- true on success, false on error (invalid filename or write error)
Definition at line 207 of file kshred.cpp.
◆ shred() [2/2]
|
static |
The simplest method to shred a file. No need to create an instance of the class.
- Parameters
-
fileName fully qualified name of the file to shred.
Definition at line 149 of file kshred.cpp.
The documentation for this class was generated from the following files: