On 05/17/2018 09:11 AM, alexander golks wrote:
my code was:
qint64 res = f.write(data);
just for the curious ones:
i have at least compiled 5.6.4 now, but i can not produce the error with my
using 5.6.3 from qt, error exists. using mine, does not exist...
getting the error code directly after the f.write(data) gives me error code 183:
Cannot create a file when that file already exists.
but i assume, that the error is not from the failing WriteFile call. or does it?
anyone with some more ideas?
e.g. on how to reproduce or test?
One of the annoying safety features of Qt is that it won't overwrite a
file. You got that error when you tried to open the file for output and
you didn't check for the error. There was some test case long ago where
it was deemed a security risk for Qt to overwrite existing files. This
deviates from standard C/C++ where you can. Before opening an output
file you need to test for its existence then delete it. You can also
play games with opening the file for I/O and truncating, but, success is
file system dependent on that one.
Roland Hughes, President
Interest mailing list