File tree 5 files changed +10
-8
lines changed
5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 39
39
40
40
// ===============For Linux=================
41
41
42
- #ifdef _linux_
42
+ #ifdef linux
43
43
44
44
#include < sys/stat.h>
45
45
#include < sys/types.h>
65
65
{
66
66
return true ;
67
67
}
68
- mkdir (dirName, S_IRWXG );
68
+ mkdir (dirName, 0777 );
69
69
return dirExists (dirName);
70
70
}
71
71
Original file line number Diff line number Diff line change 1
- main : util.o info.o basic.o def.o env.o interaction.o progress.o sentences.o stats.o strategy.o test.o main_interface.o program.o user.o settings.o factory.o
2
- g++ -o final util.o info.o basic.o def.o env.o interaction.o progress.o sentences.o stats.o strategy.o test.o user.o main_interface.o program.o settings.o factory.o
1
+ main : util.o info.o basic.o def.o env.o interaction.o progress.o sentences.o stats.o strategy.o test.o main_interface.o program.o user.o settings.o factory.o file_system.o
2
+ g++ -o final util.o info.o basic.o def.o env.o interaction.o progress.o sentences.o stats.o strategy.o test.o user.o main_interface.o program.o settings.o factory.o file_system.o
3
3
interaction.o : interaction.cpp util.h def.h strategy.h env.h sentences.h
4
4
g++ -c -g interaction.cpp
5
5
util.o : util.cpp
@@ -34,5 +34,7 @@ settings.o: settings.cpp info.h util.h interaction.h
34
34
g++ -c -g settings.cpp
35
35
factory.o : factory.cpp env.h strategy.h
36
36
g++ -c -g factory.cpp
37
+ file_system.o : file_system.cpp
38
+ g++ -c -g file_system.cpp
37
39
clean :
38
40
rm * .o
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ User::User(const string& userName) : userName(userName) {
4
4
}
5
5
6
6
void User::create () {
7
-
8
- // TODO: create directory
7
+
8
+ makeDir ( " user/ " + userName);
9
9
10
10
string prefix = " ./user/" + userName + " /" ;
11
11
ofstream ofs;
12
12
13
13
ofs.open ((prefix + " basic.dat" ).c_str ());
14
- ofs << " *all* {\n @timestamp@0.\n @level@50.\n }" ;
14
+ ofs << " *all* {\n @timestamp@0.\n @level@50.\n @selectstrategy@-1. \n @formstrategy@0. \n }" ;
15
15
ofs.close ();
16
16
ofs.clear ();
17
17
Original file line number Diff line number Diff line change 4
4
#include < fstream>
5
5
#include " info.h"
6
6
#include " util.h"
7
+ #include " file_system.h"
7
8
8
9
class User {
9
10
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments