QFile write doesn't write when data is too small.
-
QFile myfqle1("C:\\here.txt"); myfqle.open(QIODevice::WriteOnly); myfqle.write(data);Here's the code I use for opening and writing the file.
Whendata.size()is smaller than approximately 16000 bytes, it just doesn't write the data to file.How can I solve this? thanks in advance.
-
Hi,
How do you determine that ?
Until flushed or closed, your data might simply be sitting in a cash. -
Hi,
How do you determine that ?
Until flushed or closed, your data might simply be sitting in a cash.@SGaist I cannot flush because I don't use
std::cout, also closing the file doesn't work. -
QFile has a flush method.
You didn't answer my other question.
On a side note, it's a good idea to do error checking. You might be trying to write to a read-only location.
-
@SGaist I cannot flush because I don't use
std::cout, also closing the file doesn't work.@kayakaan02 said in QFile write doesn't write when data is too small.:
also closing the file doesn't work.
I bet it does!