Skip to content

Commit

Permalink
removed erroneous temp file deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed Oct 10, 2014
1 parent 67c2560 commit 8abaa12
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ System.Windows.Forms.IWin32Window revit_window
{
Util.LogError( "Upload cancelled." );

System.IO.File.Delete( filename );
return;
}

Expand Down Expand Up @@ -192,25 +191,22 @@ public Result Execute(
// Generate temporary filename for uploading
// because otherwise Revit will not allow access

string filename = Path.GetTempFileName() + ".rvt";
//string filename = Path.GetTempFileName() + ".rvt";
string filename = "C:/tmp/RvtGalleryUploader.tmp.rvt";

filename = filename.Replace( '\\', '/' ); // easier to read in debugger

Debug.Print( filename );

try
{
File.Copy( doc.PathName, filename );
File.Copy( doc.PathName, filename );

Debug.Assert( File.Exists( filename ),
"expected RVT file copy" );
Debug.Assert( File.Exists( filename ),
"expected RVT file copy" );

UploadToGallery( filename, doc.Title );

//System.IO.File.Delete( filename );

UploadToGallery( filename, doc.Title );
}
finally
{
System.IO.File.Delete( filename );
}
return Result.Succeeded;
}
}
Expand Down

0 comments on commit 8abaa12

Please sign in to comment.