tst: passthrough-dotnet: minor fix

This commit is contained in:
Bill Zissimopoulos 2017-04-10 10:34:31 -07:00
parent ac7b7f4a1b
commit e40505adb5

View File

@ -259,13 +259,9 @@ namespace passthrough
FileDesc FileDesc = (FileDesc)FileDesc0; FileDesc FileDesc = (FileDesc)FileDesc0;
if (0 != (Flags & CleanupDelete)) if (0 != (Flags & CleanupDelete))
{ {
FileName = ConcatPath(FileName);
try try
{ {
if (null == FileDesc.Stream) FileDesc.Info.Delete();
Directory.Delete(FileName);
else
FileDesc.Stream.Dispose();
} }
catch catch
{ {
@ -405,15 +401,11 @@ namespace passthrough
String FileName) String FileName)
{ {
FileDesc FileDesc = (FileDesc)FileDesc0; FileDesc FileDesc = (FileDesc)FileDesc0;
FileName = ConcatPath(FileName);
/* /*
* If a file has an open handle the Delete call below * If a file has an open handle the Delete call below
* will only mark it for disposition. * will only mark it for disposition.
*/ */
if (null == FileDesc.Stream) FileDesc.Info.Delete();
Directory.Delete(FileName);
else
File.Delete(FileName);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
protected override Int32 Rename( protected override Int32 Rename(