Skip to content

Commit

Permalink
Исправил дефекты, связанные с новой функциональностью
Browse files Browse the repository at this point in the history
  • Loading branch information
fdsc committed Feb 28, 2024
1 parent 6879c6e commit 6530049
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
30 changes: 24 additions & 6 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@ public static int Main_OneArgument(string[] args)
Console.WriteLine("z3: triple rewrite: 0xCCCC 0x6666 0x00");
}

if (flags.Contains("ndd"))
{
progress.doNotDeleteDirectories = 1;
Console.WriteLine("ndd - do not delete directories");
}

if (flags.Contains("_ndf"))
{
progress.doNotDeleteFiles = 1;
progress.doNotDeleteDirectories = 1;
Console.WriteLine("_ndf - do not delete files");
}

var creationMode = flags.Contains("cr");
if (creationMode)
{
Expand Down Expand Up @@ -319,11 +332,16 @@ public static int Main_OneArgument(string[] args)

if (progress.createWithSimpleDeleting > 0)
{
if (verbose > 0)
Console.WriteLine($"Usually directory deleting (without additional rewriting)");
if (progress.doNotDeleteDirectories == 0)
{
if (verbose > 0)
Console.WriteLine($"Usually directory deleting (without additional rewriting)");

Directory.Delete(path, true);
Console.WriteLine($"Program ended with time {progress.getMessageForEntireTimeOfSanitization}. Deletion successfull ended for directory '{path}'");
Directory.Delete(path, true);
Console.WriteLine($"Program ended with time {progress.getMessageForEntireTimeOfSanitization}. Deletion successfull ended for directory '{path}'");
}
else
Console.WriteLine($"Program ended with time {progress.getMessageForEntireTimeOfSanitization}. Creation successfull ended for directory '{path}'");

Console.CursorVisible = true;
return 0;
Expand Down Expand Up @@ -389,7 +407,7 @@ public static int Main_OneArgument(string[] args)
if (flags.Contains("pr"))
{
var dt = progress.creationTime;
progress = new Progress(SizeToRewrite: fi.Length, cntToRewrite: 1, progress: progress);
progress = new Progress(SizeToRewrite: fi.Length, cntToRewrite: 1, progress: progress) { showProgressFlag = 1 };

progress.creationTime = dt;
}
Expand Down Expand Up @@ -453,7 +471,7 @@ public static int Main_OneArgument(string[] args)
var list = di.EnumerateFiles("*", SearchOption.AllDirectories);

var dt = progress.creationTime;
progress = new Progress(progress: progress);
progress = new Progress(progress: progress) { showProgressFlag = 1 };
progress.creationTime = dt;

foreach (var file in list)
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dotnet publish --output ./publish/build.lin64sc -c Release -r linux-x64 --self-c
7z a -y -t7z -stl -m0=lzma -mx=9 -ms=on -bb0 -bd -ssc -ssw ./publish/sdel-lin64.7z ./publish/build.lin64/ >> /dev/null
7z a -y -t7z -stl -m0=lzma -mx=9 -ms=on -bb0 -bd -ssc -ssw ./publish/sdel-lin64sc.7z ./publish/build.lin64sc/ >> /dev/null

echo
date
echo
echo 'Published in '
echo `realpath ./publish`
Expand Down
Binary file modified publish/sdel-dotnet.7z
Binary file not shown.
Binary file modified publish/sdel-lin64.7z
Binary file not shown.
Binary file modified publish/sdel-lin64sc.7z
Binary file not shown.
14 changes: 5 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ but if there is equipment for physical connection to the microcontroller, then t
Overwriting an empty space on a hard (magnetic) disk.

sudo sdel crds_prv_sl ~/_toErase
Then you can delete the directory in the usual way (through the functions of the operating system)
sudo rm -rf ~/_toErase

After such a rewrite, it is recommended to clear the inode.

Expand All @@ -151,13 +149,13 @@ After such a rewrite, it is recommended to clear the inode.

Overwriting an empty space on an SSD or flash drive (the essence is the same only in different cases).

sudo sdel crd_ndf_prv_sl ~/_toErase
sudo sdel crds_ndf_prv_sl ~/_toErase
sudo sdel _ndf_pr ~/_toErase
sudo rm -rf ~/_toErase

OR

sudo sdel crd_ndf_prv_sl ~/_toErase
sudo sdel crds_ndf_prv_sl ~/_toErase
sudo sdel _ndf_pr ~/_toErase
sudo sdel pr ~/_toErase

Expand Down Expand Up @@ -307,23 +305,21 @@ sdel z_prv /swapfile
Перезапись пустого места на жёстком (магнитном) диске.

sudo sdel crds_prv_sl ~/_toErase
Затем можно удалить директорию обычным образом (через функции операционной системы)
sudo rm -rf ~/_toErase

После такой перезаписи рекомендуется очистить inode.
После такой перезаписи рекомендуется очистить inode (иными программами).
"sl" замедлит перезапись, так как будет вставлять паузы. Это позволит избежать существенного замедления других программ.
"~/_toErase" - это несуществующая директория, которая будет создана программой. Она должна быть расположена на том диске, который мы хотим перезаписать.


Перезапись пустого места на SSD или флеш-накопителе (суть одно и то же только в разных корпусах).

sudo sdel crd_ndf_prv_sl ~/_toErase
sudo sdel crds_ndf_prv_sl ~/_toErase
sudo sdel _ndf_pr ~/_toErase
sudo rm -rf ~/_toErase

ИЛИ

sudo sdel crd_ndf_prv_sl ~/_toErase
sudo sdel crds_ndf_prv_sl ~/_toErase
sudo sdel _ndf_pr ~/_toErase
sudo sdel pr ~/_toErase

Expand Down

0 comments on commit 6530049

Please sign in to comment.