Solved Copy a file with Read and Write Permissions
-
Hi everybody,
when I'm copying a file in c++ on Qt:QFile::copy( ":/myFolder/old.txt","./myFolder/new.txt");
The new file has only Read Permissions,
How can I convert this file to write too?
Thank you very much
-
How can I convert this file to write too?
I haven't tested this, but it looks like you would use QFile::setPermissions:
QFile::copy( ":/myFolder/old.txt","./myFolder/new.txt"); QFile::setPermissions("./myFolder/new.txt", QFileDevice::ReadOwner|QFileDevice::WriteOwner);
Cheers.
-
-
Yes, it works fine, thank you.
-
@carles.sole.grau Hi! Please use the button "Topic Tools" to mark the topic as "solved".