C++ (Qt) QString s = QDesktopServices::storageLocation(QDesktopServices::TempLocation).replace("/","\\"); if (f.copy(":/new/prefix1/1111.xlsx",s+"111.xlsx")) QMessageBox::about(0,"","File copy: OK"); else{ QMessageBox::about(0,"File copy: ",f.errorString()+ ": "+s+"111.xlsx"); }
C++ (Qt)while(!asleep()) sheep++;
C++ (Qt) QFile f; QString s = QDir::tempPath().replace("/","\\") +"\\"; QDir dir(s); if(dir.exists()){ QMessageBox::about(0,"Есть директория",s); } else{ QMessageBox::about(0,"","Нет директория"); } f.setFileName(":/new/prefix1/1111.xlsx"); if(f.exists()){ QMessageBox::about(0,"","Есть файл"); } else{ QMessageBox::about(0,"","Нет файл"); } if (f.copy(s+"1121.xlsx")) QMessageBox::about(0,"","File copy: OK"); else{ QMessageBox::about(0,"File copy: ",f.errorString()+ ": "+s+"1121.xlsx"); } f.close(); f.setFileName(s+"1121.xlsx"); if (f.remove() ) QMessageBox::about(0,"","File delete: OK"); else{ QMessageBox::about(0,"File delete: ",f.errorString()+s+"1121.xlsx"); }