I had to change the program to Qt, which I did not write. I found a place in the code and I know what I want, but I do not know what to change, so seek help. The code is as follows:
QFile file(path);
qint64 size = filesize(path);
qint64 blockSize = 10240;
bool ok = file.open(QIODevice::ReadWrite);
if (ok)
{
QTime t;
t.start();
file.seek(0);
for (int i = 0; i < ceil(double(size) / double(blockSize)); i++)
{
qint64 block = size - i * blockSize;
if (block > blockSize)
{
block = blockSize;
}
QByteArray data;
data.resize(block);
data.fill('0');
file.write(data, block);
}
file.close();
file.remove();
}
Here they are replaced by the contents of the file with zeros to make it impossible to recover after deleting it. Googling I came to two conclusions: either there is no real record in the file, or it writes new data to other sectors of the disk, and the old ones remain in place. How to make the contents of the file really replaced with zeros by the inability to restore it? Any help would be really appreciated!
source
share