Qt file size limit -


i know how read | write | open files in qt. trying achieve this; how create new file when existing file exceeds 'x' size? instance, have 100kb file size, before writing same file, check size, if size exceed 100kb, create new 1 (not removing existing one), chmod if needed, keep on writing.

i tried this:

qstring filename("w:/file.txt");     qfile file(filename);     qfileinfo info(file);     int size = 0;     if (file.open(qiodevice::readwrite | qiodevice::truncate))     {         qtextstream stream(&file);         while(size < 102400) {             stream << "something" << endl;             size += info.size();         }     }     qdebug() << info.size(); 

try qfileinfo::size() return file size in bytes.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -