- // last_encode_log.txt is the primary log file. Since .NET can't read this file whilst the CLI is outputing to it (Not even in read only mode),\r
- // we'll need to make a copy of it.\r
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
- string logFile = Path.Combine(logDir, _readFile);\r
- string logFile2 = Path.Combine(logDir, "tmp_appReadable_log.txt");\r
-\r
- // Make sure the application readable log file does not already exist. FileCopy fill fail if it does.\r
- if (File.Exists(logFile2))\r
- File.Delete(logFile2);\r
-\r
- // Copy the log file.\r
- if (File.Exists(logFile))\r
- File.Copy(logFile, logFile2, true);\r
- else\r
- {\r
- if (fileNotFoundQuickFix)\r
- return "";\r
- fileNotFoundQuickFix = true;\r
- return "\n\n\nERROR: The log file could not be found. \nMaybe you cleared your system's tempory folder or maybe you just havn't run an encode yet. \nTried to find the log file in: " + logFile;\r
- }\r
-\r
- StreamReader sr = new StreamReader(logFile2);\r
- string line;\r
- int i = 1;\r
- while ((line = sr.ReadLine()) != null)\r