class KShred

# class KShred | Erase a file in a way that makes recovery impossible -- well, no guarentee of that, but at least as difficult as reasonably possible. More...
Definition | `#include <kshred.h>`
Inherits | QObject (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KShred (QString fileName)
- ~KShred ()
- bool fill1s ()
- bool fill0s ()
- bool fillbyte (unsigned int byte)
- bool fillrandom ()
- bool fillpattern (unsigned char *pattern, unsigned int size)
- bool shred ()

#### Signals

- void processedSize (KIO::filesize_t bytes)
- void infoMessage (const QString &)

#### Public Static Methods

- static bool shred (QString fileName)

## Detailed Description

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.

KShred (QString fileName) | ### KShred

Initialize the class using the name of the file to 'shred'.

Parameters:

fileName | fully qualified name of the file to shred.

~KShred () | ### ~KShred

bool fill1s () | ### 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)

bool fill0s () | ### 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)

bool fillbyte (unsigned int byte) | ### fillbyte

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)

bool fillrandom () | ### 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)

bool fillpattern (unsigned char *pattern, unsigned int size) | ### fillpattern

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)

bool shred () | ### 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)

bool shred (QString fileName) | ### shred

[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.

void processedSize (KIO::filesize_t bytes) | ### processedSize

[signal]

Shows progress of the shredding.

Parameters:

bytes | the number of bytes written to the file

void infoMessage (const QString &) | ### infoMessage

[signal]

Shows a message in the progress dialog

Parameters:

the | message to display

- Author: David Faure (integration into KDE and progress signal)
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:57 2003, using kdoc 2.0a54.