From cb326a9d8db966125b0f47674e87e06639b10bc6 Mon Sep 17 00:00:00 2001 From: dmarakom6 Date: Mon, 19 Apr 2021 22:32:01 +0300 Subject: [PATCH] Fix Bug: clearlogs generates logs inside exec --- logs/.clearlogs.cpp | 12 ++++++------ logs/ufailed.txt | 2 -- util/.hidden/.resetshellnotes.sh | 1 + util/exec/clearlogs | Bin 17768 -> 17768 bytes util/logfiles/disfailed.cpp | 22 ++++++++++++++++++++++ util/logfiles/enfailed.cpp | 22 ++++++++++++++++++++++ util/logfiles/ifailed.cpp | 22 ++++++++++++++++++++++ util/logfiles/sdfailed.cpp | 23 +++++++++++++++++++++++ util/logfiles/ufailed.cpp | 22 ++++++++++++++++++++++ util/logfiles/uninfailed.cpp | 22 ++++++++++++++++++++++ 10 files changed, 140 insertions(+), 8 deletions(-) create mode 100644 util/logfiles/disfailed.cpp create mode 100644 util/logfiles/enfailed.cpp create mode 100644 util/logfiles/ifailed.cpp create mode 100644 util/logfiles/sdfailed.cpp create mode 100644 util/logfiles/ufailed.cpp create mode 100644 util/logfiles/uninfailed.cpp diff --git a/logs/.clearlogs.cpp b/logs/.clearlogs.cpp index db9a941..33acbde 100644 --- a/logs/.clearlogs.cpp +++ b/logs/.clearlogs.cpp @@ -14,16 +14,16 @@ using namespace std; int main () { std::ofstream ofs; - ofs.open("sdfailed.txt", std::ofstream::out | std::ofstream::trunc); + ofs.open("../../logs/sdfailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.close(); - ofs.open("ufailed.txt", std::ofstream::out | std::ofstream::trunc); + ofs.open("../../logs/ufailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.close(); - ofs.open("ifailed.txt", std::ofstream::out | std::ofstream::trunc); + ofs.open("../../logs/ifailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.close(); - ofs.open("enfailed.txt", std::ofstream::out | std::ofstream::trunc); + ofs.open("../../logs/enfailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.close(); - ofs.open("disfailed.txt", std::ofstream::out | std::ofstream::trunc); + ofs.open("../../logs/disfailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.close(); - ofs.open("uninfailed.txt", std::ofstream::out | std::ofstream::trunc); + ofs.open("../../logs/uninfailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.close(); } \ No newline at end of file diff --git a/logs/ufailed.txt b/logs/ufailed.txt index 7f3531f..e69de29 100644 --- a/logs/ufailed.txt +++ b/logs/ufailed.txt @@ -1,2 +0,0 @@ -UPDATE FAILED IN Mon Apr 19 21:51:16 2021 - diff --git a/util/.hidden/.resetshellnotes.sh b/util/.hidden/.resetshellnotes.sh index 259dc32..7d0c94c 100644 --- a/util/.hidden/.resetshellnotes.sh +++ b/util/.hidden/.resetshellnotes.sh @@ -17,5 +17,6 @@ function resetshellnotes() { echo "/bin/nano"> ~/.shellnotes/util/sd/sd-input2.txt echo "~/Notes" > ~/.shellnotes/util/sd/sd-input3.txt esac + cd $DIR return 0 } \ No newline at end of file diff --git a/util/exec/clearlogs b/util/exec/clearlogs index b9f9dec82d94c60bbcc2b4e5d58c05f17e099047..e7e5400037c05ada878a5a654740afc00838171a 100644 GIT binary patch delta 554 zcmaFS#rUF&af1UR=WHehFqpmBlTn{haE1be3#TV{GTj$x=Fz*ai$ONCcjcpV~m(As3$VFc^Rio=5*5M gL`1KnlR4)P1)%Xj@MCf#kk_FE;dN|2=(L;(0L&k$ivR!s delta 491 zcmaFS#rUF&af1URXD|~37zA(jWYlLA3{ik^;q>HAru!n3TGz<^z0vV-zFw`+ZLSID z3agreH`g%h@H3`OUMXbCXfydfkQACMDs0O1l4r7yunFVA&5gn>JoUvXX^ELRsVRCT z6(tO%NbF1`c4{6HCnd8OiC3DJi7d$|&1@Y3bRicIpLzfPe-Dt3`SAb$79gDiq|X59 zH$b`sNMHT<|G$w9ll%xuP zdi8-)3@+>fAW8*@O@P?q{bVCWHOU1)E5YI*IUo=LVvtocCKoD-Gl_kk+@+`~wp5OR zL0X!Jonr#fY>)vUymInMMRi7x$sZNv8A~S%D# +#include +#include + +using namespace std; + +int main() +{ + time_t now = time(0); + char* dt = ctime(&now); + std::ofstream outfile ("../../logs/disfailed.txt", std::ios_base::app); + outfile << "DISABLING FAILED IN " << dt << "\n"; + outfile.close(); + return 0; +} \ No newline at end of file diff --git a/util/logfiles/enfailed.cpp b/util/logfiles/enfailed.cpp new file mode 100644 index 0000000..738c8de --- /dev/null +++ b/util/logfiles/enfailed.cpp @@ -0,0 +1,22 @@ +/* +shellnotes - enfailed.cpp +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +*/ + +#include +#include +#include + +using namespace std; + +int main() +{ + time_t now = time(0); + char* dt = ctime(&now); + std::ofstream outfile ("../../logs/enfailed.txt", std::ios_base::app); + outfile << "ENABLING FAILED IN " << dt << "\n"; + outfile.close(); + return 0; +} \ No newline at end of file diff --git a/util/logfiles/ifailed.cpp b/util/logfiles/ifailed.cpp new file mode 100644 index 0000000..2f8e7d4 --- /dev/null +++ b/util/logfiles/ifailed.cpp @@ -0,0 +1,22 @@ +/* +shellnotes - ifailed.cpp +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +*/ + +#include +#include +#include + +using namespace std; + +int main() +{ + time_t now = time(0); + char* dt = ctime(&now); + std::ofstream outfile ("../../logs/ifailed.txt", std::ios_base::app); + outfile << "INSTALLATION FAILED IN " << dt << "\n"; + outfile.close(); + return 0; +} \ No newline at end of file diff --git a/util/logfiles/sdfailed.cpp b/util/logfiles/sdfailed.cpp new file mode 100644 index 0000000..2a07da3 --- /dev/null +++ b/util/logfiles/sdfailed.cpp @@ -0,0 +1,23 @@ +/* +shellnotes - sdfailed.cpp +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +*/ + +#include +#include +#include + +using namespace std; + +int main() +{ + time_t now = time(0); + char* dt = ctime(&now); + ofstream sdfailed; + std::ofstream outfile ("../../logs/sdfailed.txt", std::ios_base::app); + outfile << "INVALID PATH FOR DEFAULT EDITOR/FOLDER IN " << dt << "\n"; + outfile.close(); + return 0; +} \ No newline at end of file diff --git a/util/logfiles/ufailed.cpp b/util/logfiles/ufailed.cpp new file mode 100644 index 0000000..4f181dc --- /dev/null +++ b/util/logfiles/ufailed.cpp @@ -0,0 +1,22 @@ +/* +shellnotes - ufailed.cpp +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +*/ + +#include +#include +#include + +using namespace std; + +int main() +{ + time_t now = time(0); + char* dt = ctime(&now); + std::ofstream outfile ("../../logs/ufailed.txt", std::ios_base::app); + outfile << "UPDATE FAILED IN " << dt << "\n"; + outfile.close(); + return 0; +} \ No newline at end of file diff --git a/util/logfiles/uninfailed.cpp b/util/logfiles/uninfailed.cpp new file mode 100644 index 0000000..557148b --- /dev/null +++ b/util/logfiles/uninfailed.cpp @@ -0,0 +1,22 @@ +/* +shellnotes - uninfailed.cpp +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +*/ + +#include +#include +#include + +using namespace std; + +int main() +{ + time_t now = time(0); + char* dt = ctime(&now); + std::ofstream outfile ("../../logs/uninfailed.txt", std::ios_base::app); + outfile << "UNINSTALLATION FAILED IN " << dt << "\n"; + outfile.close(); + return 0; +} \ No newline at end of file