0

It seems that on Windows I can't write to the Program Files or Program Files (x86) directories or their sub-directories anymore.

What I don't understand is how my app is letting that happen when I'm checking the following things

QFile newfile("C://Program Files/target.rar");
QFileInfo newfileInfo("C://Program Files/target.rar");

newfile.exists(); //returns true
newfile.isWritable(); // returns true
newfileInfo.exists(); // returns true
newfileInfo.isWritable(); // returns true   

none of those should return true in Program Files. Strangely it actually proceeds to write to this non-existent file, even though nothing is there, and it produces no write errors.

stukennedy
  • 1,088
  • 1
  • 9
  • 25

1 Answers1

1

You may be a victim of UAC Virtualization. Check %userprofile%\AppData\Local\VirtualStore\Program Files to see whether your file is there.

Paul
  • 13,042
  • 3
  • 41
  • 59
  • I am!! I have just figured it out after reading this http://stackoverflow.com/questions/4640730/qt-cannot-cannot-create-write-to-c – stukennedy Dec 09 '15 at 20:30