[email protected]
[Top] [All Lists]

Problems saving to a QFile ?

Subject: Problems saving to a QFile ?
From: Sean Crees
Date: Fri, 13 Jun 2008 12:36:05 +0100

We have a customer who is having problems saving from our application to a 'shared filesystem'.

Our application is built with Qt4.3.0 and the user is running on Windows XP - saving to the filesystem on another windows XP PC, as either a mapped drive or as a UNC Path.

When saving data in compressed form we use a QFile e.g.

           QFile file( filename);
           if (file.open( QIODevice::WriteOnly ))
               QDataStream stream( &file );
               // stream header data
               stream << label;
               stream << version;

               QByteArray data = qCompress(modelData);
stream << data; file.close();

and in uncompressed form we use standard iostream e.g.

          std::ofstream stream(filename);
           if (stream)
{ // write header
               stream << label;
               stream << version;
stream <<modelData << "\n";

When the user uses ofstream code the file saves correctly, but when using QFile the call to file.open fails, error string from QFile is "Unknown error".

As far as we can tell the user does have permissions to write to the file system - and when using ostream code the file is written correctly.

Does anybody have any ideas/suggestions as to what could be going wrong in QFile? And how to correct it?

Thanks for any help,

Regards, Sean Crees.

To unsubscribe - send a mail to [email protected] with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>
  • Problems saving to a QFile ?, Sean Crees <=