Skip to content

修改了main.cpp #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <iostream>
#include <fstream>

#include "const.h"
#include "interpreter.h"
Expand All @@ -7,11 +8,32 @@ BufferManager buffer_manager(MAXFRAMESIZE);
Interpreter query;

int main(int argc, const char* argv[]) {
// 请在Linux或MacOS系统下使用如下命令重新编译
system("mkdir -p database");
system("mkdir -p ./database/index");
system("mkdir -p ./database/catalog");
system("mkdir -p ./database/data");
system("touch ./database/catalog/catalog_file");

/*
// 请在Windows系统下使用如下命令重新编译
system("mkdir database");
system("mkdir .\\database\\index");
system("mkdir .\\database\\catalog");
system("mkdir .\\database\\data");
fstream fs;
fs.open(".\\database\\catalog\\catalog_file", ios::in);
if (!fs)
{
ofstream fout(".\\database\\catalog\\catalog_file");
fout.close();
}
else
{
fs.close();
}
*/

if (argc > 1) {
if (string(argv[1]) == "without_io") {
query.closeIO();
Expand Down