creating spool dir if not exist
This commit is contained in:
parent
5124b73802
commit
c3bb33cf69
4
Makefile
4
Makefile
@ -27,4 +27,6 @@ $(BUILD_DIR)/%.o: %.cpp
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) twmailer-client twmailer-server
|
||||
rm -rf $(BUILD_DIR) twmailer-client twmailer-server
|
||||
|
||||
.PHONY: all client server clean
|
||||
@ -64,13 +64,15 @@ user_handler* user_handler::instancePtr = nullptr;
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
if (argc < 3 ||
|
||||
!isInteger(argv[1]) ||
|
||||
!fs::is_directory(argv[2])
|
||||
) {
|
||||
!isInteger(argv[1])) {
|
||||
printUsage();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!fs::is_directory(argv[2])) {
|
||||
fs::create_directory(argv[2]);
|
||||
}
|
||||
|
||||
fs::path spool_dir = fs::path(argv[2]);
|
||||
fs::create_directory(spool_dir/"users");
|
||||
fs::create_directory(spool_dir/"messages");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user