Changeset 4306 in vbox
- Timestamp:
- Aug 23, 2007 10:14:15 AM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r4297 r4306 7115 7115 Utf8Str logFile = Utf8StrFmt ("%s%cVBox.log", 7116 7116 logDir.raw(), RTPATH_DELIMITER); 7117 Utf8Str pngFile = Utf8StrFmt ("%s%cVBox.png", 7118 logDir.raw(), RTPATH_DELIMITER); 7117 7119 7118 7120 /* … … 7123 7125 for (int i = 2; i >= 0; i--) 7124 7126 { 7125 Utf8Str oldName; 7126 if (i > 0) 7127 oldName = Utf8StrFmt ("%s.%d", logFile.raw(), i); 7128 else 7129 oldName = logFile; 7130 Utf8Str newName = Utf8StrFmt ("%s.%d", logFile.raw(), i + 1); 7131 RTFileRename(oldName.raw(), newName.raw(), RTFILEMOVE_FLAGS_REPLACE); 7127 Utf8Str *files[] = { &logFile, &pngFile }; 7128 Utf8Str oldName, newName; 7129 7130 for (int j = 0; j < ELEMENTS (files); ++ j) 7131 { 7132 if (i > 0) 7133 oldName = Utf8StrFmt ("%s.%d", files [j]->raw(), i); 7134 else 7135 oldName = *files [j]; 7136 newName = Utf8StrFmt ("%s.%d", files [j]->raw(), i + 1); 7137 /* If the old file doesn't exist, delete the new file (if it 7138 * exists) to provide correct rotation even if the sequence is 7139 * broken */ 7140 if (RTFileRename (oldName, newName, RTFILEMOVE_FLAGS_REPLACE) == 7141 VERR_FILE_NOT_FOUND) 7142 RTFileDelete (newName); 7143 } 7132 7144 } 7133 7145 -
trunk/src/VBox/Main/MachineImpl.cpp
r4071 r4306 2242 2242 if (RTDirExists (logFolder)) 2243 2243 { 2244 /* delete all VBox.log[.N] files from the Logs folder2244 /* Delete all VBox.log[.N] files from the Logs folder 2245 2245 * (this must be in sync with the rotation logic in 2246 * Console::powerUpThread()) */ 2246 * Console::powerUpThread()). Also, delete the VBox.png[.N] 2247 * files that may have been created by the GUI. */ 2247 2248 Utf8Str log = Utf8StrFmt ("%s/VBox.log", logFolder.raw()); 2249 RTFileDelete (log); 2250 log = Utf8StrFmt ("%s/VBox.png", logFolder.raw()); 2248 2251 RTFileDelete (log); 2249 2252 for (int i = 3; i >= 0; i--) 2250 2253 { 2251 2254 log = Utf8StrFmt ("%s/VBox.log.%d", logFolder.raw(), i); 2255 RTFileDelete (log); 2256 log = Utf8StrFmt ("%s/VBox.png.%d", logFolder.raw(), i); 2252 2257 RTFileDelete (log); 2253 2258 }
Note:
See TracChangeset
for help on using the changeset viewer.