Fix Bug: clearlogs generates logs inside exec

This commit is contained in:
dmarakom6 2021-04-19 22:32:01 +03:00
parent 20dbd71665
commit cb326a9d8d
10 changed files with 140 additions and 8 deletions

View file

@ -14,16 +14,16 @@ using namespace std;
int main () int main ()
{ {
std::ofstream ofs; 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.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.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.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.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.close();
ofs.open("uninfailed.txt", std::ofstream::out | std::ofstream::trunc); ofs.open("../../logs/uninfailed.txt", std::ofstream::out | std::ofstream::trunc);
ofs.close(); ofs.close();
} }

View file

@ -1,2 +0,0 @@
UPDATE FAILED IN Mon Apr 19 21:51:16 2021

View file

@ -17,5 +17,6 @@ function resetshellnotes() {
echo "/bin/nano"> ~/.shellnotes/util/sd/sd-input2.txt echo "/bin/nano"> ~/.shellnotes/util/sd/sd-input2.txt
echo "~/Notes" > ~/.shellnotes/util/sd/sd-input3.txt echo "~/Notes" > ~/.shellnotes/util/sd/sd-input3.txt
esac esac
cd $DIR
return 0 return 0
} }

Binary file not shown.

View file

@ -0,0 +1,22 @@
/*
shellnotes - disfailed.cpp
(C) Dimitris Marakomihelakis
Released under the "All rights reserved" category. See the RIGHTS.txt file
in /docs/github/ for its full text.
*/
#include <iostream>
#include <fstream>
#include <ctime>
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;
}

View file

@ -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 <iostream>
#include <fstream>
#include <ctime>
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;
}

22
util/logfiles/ifailed.cpp Normal file
View file

@ -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 <iostream>
#include <fstream>
#include <ctime>
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;
}

View file

@ -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 <iostream>
#include <fstream>
#include <ctime>
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;
}

22
util/logfiles/ufailed.cpp Normal file
View file

@ -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 <iostream>
#include <fstream>
#include <ctime>
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;
}

View file

@ -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 <iostream>
#include <fstream>
#include <ctime>
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;
}