Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
zyr17 committed Mar 14, 2024
1 parent 6288b8d commit 17925e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int Access(const char *filename, int mode){
if (filename_string.find("data/") == 0)
full_filename = Header::appledatafolderprefix + filename;
#endif
std::cout << "Access " << full_filename << '\n';
std::cout << "Access " << full_filename << std::endl;
return access(full_filename.c_str(), mode);
}

Expand All @@ -353,7 +353,7 @@ CJsonObject ReadJSON(const std::string &filename){
if (filename.find("data/") == 0)
full_filename = Header::appledatafolderprefix + filename;
#endif
std::cout << "ReadJSON " << full_filename << '\n';
std::cout << "ReadJSON " << full_filename << std::endl;
auto f = fopen(full_filename.c_str(), "r");
for (; ; ){
int length = fread(buffer, 1, JSONBUFFERSIZE - 1, f);
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ namespace MAIN{
}
_findclose(findi2);
#elif defined(__linux) || defined(__APPLE__)
std::cout << "try to open: " << dataprefix + "data/" + source << std::endl;
DIR *dirptr = opendir((dataprefix + "data/" + source).c_str());
std::cout << "open success: " << dataprefix + "data/" + source << std::endl;
dirent *entry;
while (entry = readdir(dirptr)){
ids.push_back(entry -> d_name);
Expand Down

0 comments on commit 17925e8

Please sign in to comment.