Skip to content

Commit

Permalink
Create directory if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Nov 11, 2023
1 parent 9194f24 commit 4d35dfb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ntcoreffi/src/main/native/cpp/DataLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ static std::string MakeLogDir(std::string_view dir) {
"DataLogManager: Logging to RoboRIO 1 internal storage is "
"not recommended! Plug in a FAT32 formatted flash drive!");
}
fs::create_directory("/home/lvuser/logs", ec);
return "/home/lvuser/logs";
#else
return filesystem::GetOperatingDirectory();
Expand Down
1 change: 1 addition & 0 deletions wpilibc/src/main/native/cpp/DataLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static std::string MakeLogDir(std::string_view dir) {
"DataLogManager: Logging to RoboRIO 1 internal storage is "
"not recommended! Plug in a FAT32 formatted flash drive!");
}
fs::create_directory("/home/lvuser/logs", ec);
return "/home/lvuser/logs";
#else
return filesystem::GetOperatingDirectory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ private static String makeLogDir(String dir) {
+ " Plug in a FAT32 formatted flash drive!",
false);
}
new File("/home/lvuser/logs").mkdir();
return "/home/lvuser/logs";
}
return Filesystem.getOperatingDirectory().getAbsolutePath();
Expand Down

0 comments on commit 4d35dfb

Please sign in to comment.