Friday, 15 April 2011

c++ - Copy file even when destination exists (in Qt) -



c++ - Copy file even when destination exists (in Qt) -

in qfile::copy documentation says

if file name newname exists, copy() returns false (i.e., qfile not overwrite it).

but need re-create file if destination exists. workaround available in qt that?

if (qfile::exists("/home/user/dst.txt")) { qfile::remove("/home/user/dst.txt"); } qfile::copy("/home/user/src.txt", "/home/user/dst.txt");

c++ qt file-copying

No comments:

Post a Comment