If file exists, then overwrite it. (#374)
authorJosé Rivero <jorive@microsoft.com>
Mon, 1 Jul 2019 18:36:57 +0000 (11:36 -0700)
committerGitHub <noreply@github.com>
Mon, 1 Jul 2019 18:36:57 +0000 (11:36 -0700)
src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs
src/Tools/dotnet-trace/CommandLine/Commands/ErrorCode.cs

index 13d4d286cb347acb3367a0e448e8029c10c33342..81ad437d2941695164fc0af63428a30df8be3b2b 100644 (file)
@@ -111,11 +111,7 @@ namespace Microsoft.Diagnostics.Tools.Trace
                         Console.Error.WriteLine("Unable to create session.");
                         return ErrorCodes.SessionCreationError;
                     }
-                    if (File.Exists(output.FullName))
-                    {
-                        Console.Error.WriteLine($"Unable to create file {output.FullName}. Try using -o or --output option to specify a different output file name.");
-                        return ErrorCodes.FileCreationError;
-                    }
+
                     var collectingTask = new Task(() => {
                         try
                         {
index de806c69533e5adb21f30e33eba4d2c16d745c84..d3400a3328c7db21d28bc92329205bd84be27c88 100644 (file)
@@ -6,10 +6,9 @@ namespace Microsoft.Diagnostics.Tools.Trace
 {
     internal static class ErrorCodes
     {
-        public static int SessionCreationError = 1;
-        public static int FileCreationError = 2;
-        public static int TracingError = 3;
-        public static int ArgumentError = 4;
-        public static int UnknownError = 5;
+        public const int SessionCreationError = 1;
+        public const int TracingError = 2;
+        public const int ArgumentError = 3;
+        public const int UnknownError = 4;
     }
 }
\ No newline at end of file