PDA

View Full Version : Copy a file?



whitefurrows
26th July 2007, 22:16
Hello,

when i try to copy a file, create qt additional a file like this "qt_temp.xxxxxx". That do qt only when "if (settings)" come true.


QFile file(QDir::home().absolutePath() + "/settings.xml);
if (settings) //e.g. settings = "c:\programs\myapp\settings.xml"
{
file.setFileName(settings);
}
if (file.exists() == false)
{
file.copy( ":/settings/settings.xml", file.fileName() );
}

Can anyone help me?

Thanks.

patrik08
26th July 2007, 22:48
on window i found problem copy direct from resource to other file...
open in on QDomDocument and save string to file... is secure and file permission looks ok...

whitefurrows
27th July 2007, 21:05
In this case can i use QDomDocument and that works fine for me, thank you. Sometime i do this with other files what an i do in this case?