[Qt-interest] QFile::remove() fails on Windows Vista

Yevgen Muntyan muntyan at fastmail.fm
Tue Jun 23 19:40:42 CEST 2009


Thiago Macieira wrote:
> Yevgen Muntyan wrote:
>   
>> Hey,
>>
>> I have a problem with QFile::rename: it fails when it tries to remove
>> the temporary file it uses, because DeleteFileW() fails inside
>> QFSFileEngine::remove(). My code is roughly the following:
>>
>> QFile source(":/gap/ggap.g");
>> source.copy("C:/Users/muntyan/AppData/Local/Temp/ggap-000025cb/ggap.g")
>>
>> The copy() call here fails.
>> "C:/Users/muntyan/AppData/Local/Temp/ggap-000025cb" directory is created
>> with QDir::mkdir(), and I do have permissions to delete files from it,
>> and I can delete files from it in explorer. The temporary files
>> qt_temp.XXXXXX are not read-only, so DeleteFile() isn't supposed to
>> fail. But it does!
>>
>> Any idea what's going on and how to rename files so that it works on
>> Vista?
>>     
>
> We've fixed a couple of issues with renaming temporary files for Qt 4.5.2. 
> Can you test the current 4.5 sources from Git, or try 4.5.2 as soon as 
> it's out and let us know if your problem has been fixed?
>   

I could not build qt from git, configure said it couldn't find bunch of 
files, and then qmake compilation
failed, it couldn't find qstringlist.h. So I'll wait for 4.5.2. 
Meanwhile I probably need to avoid using
temporary files.

Thanks,
Yevgen




More information about the Qt-interest-old mailing list