I had to change the program on Qt that I did not write. I located the place in the code and know what I want it to, but I do not know what to change, so seek help. 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 are replaced by the contents of the file with zeros for the inability to recover after its deletion. Googling I came to two conclusions, either there is no real writing in the file, or it writes new data to other disk sectors, and the old remain in place. How to make so that the contents of the file really replaced with zeros for the inability to recover it? Any help will be really appreciated!