Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,7 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

# NuGet
.nuget/
11 changes: 7 additions & 4 deletions IOTracer/WriterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,27 @@ private static bool IsTimeToCompress(string filepath)
public void CompressWrite(string tracetype)
{
string old_fp;
string new_fp = null;
string compressed_fp;
if (tracetype.Equals("filesystem"))
{
old_fp = fs_filepath;
fs_filepath = GenerateFilePath("fs");
new_fp = fs_filepath;
FlushWrite(fs_sb, old_fp);
}
else if (tracetype.Equals("disk"))
{
old_fp = ds_filepath;
ds_filepath = GenerateFilePath("ds");
new_fp = ds_filepath;
FlushWrite(ds_sb, old_fp);
}
else if (tracetype.Equals("memory"))
{
old_fp = mr_filepath;
mr_filepath = GenerateFilePath("mr");
new_fp = mr_filepath;
FlushWrite(mr_sb, old_fp);
}
else
Expand All @@ -170,7 +174,7 @@ public void CompressWrite(string tracetype)



Console.WriteLine($"Writing to new file: {fs_filepath}");
Console.WriteLine($"Writing to new file: {new_fp}");

Console.WriteLine($"Compressing {old_fp}");
using (var input = File.OpenRead(old_fp))
Expand All @@ -182,10 +186,9 @@ public void CompressWrite(string tracetype)
Console.WriteLine($"Compressed {old_fp} → {compressed_fp}");
amount_compressed_file++;

string full_path_old = Path.GetFullPath(old_fp);
if (File.Exists(full_path_old))
if (File.Exists(old_fp))
{
File.Delete(full_path_old);
File.Delete(old_fp);
Console.WriteLine("File deleted successfully.");
}
else
Expand Down
5 changes: 2 additions & 3 deletions IOTracesCORE/WriterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,9 @@ public static string CompressFile(string filepath)
amount_compressed_file++;


string full_path_old = Path.GetFullPath(filepath);
if (File.Exists(full_path_old))
if (File.Exists(filepath))
{
File.Delete(full_path_old);
File.Delete(filepath);
//Console.WriteLine("File deleted successfully.");
}
else
Expand Down