-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
29 lines (26 loc) · 1.03 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "variable.h" //The customize function by self, so used "" for customize-function
int main()
{
if(!std::filesystem::exists(Log_Directory))
{
//std::filesystem::create_directories(Log_Directory); // create the directory
if(std::filesystem::create_directories(Log_Directory))
{
//std::cout << "Created!";
}
else
{
std::cerr << "FILE WAS FAILD TO CREAT, PLEASE TYR AGAING !\n";
return 1;
}
}
in.open(Log_file); //start the file first
if(!out.is_open()) //if the file which called "Log_file" not start, the code will create for the file which called "pswd.log"
{
out.open(Log_file, std::ios::app);
out << "[ " << 1900 + ltm->tm_year << "/" << 1 + ltm->tm_mon << "/" << ltm->tm_mday << " " << ltm->tm_hour << ":" << ltm->tm_min << ":" << ltm->tm_sec << " ]" << " Empty Log was created!" << std::endl; //Wrote in pswd.log
}
in.close();
out.close();
return 0;
}