символьные ссылки в планировщике

This commit is contained in:
2025-02-06 21:23:55 +03:00
parent bd2e8643fd
commit 0c2b716368
6 changed files with 14 additions and 12 deletions

View File

@@ -83,7 +83,7 @@ public:
void prepareWorkspace() override {
String binary_src = parent->getWorkspace() + "/0";
String binary_dst = workspace + "/" + binary_name;
Utils::Copy(binary_src, binary_dst);
Utils::Ln(binary_src, binary_dst);
if (!usr_par.isEmpty()) {
String parPath = String(id) + "/usr.par";
File parFile = File(parPath, usr_par);

View File

@@ -65,6 +65,15 @@ public:
//printf("cp '%s' return code = %d\n",src.getCharArray(), i);
#endif
}
static void Ln(const String& src, const String& dst) {
#if __cplusplus >= 201703L
std::filesystem::create_symlink(src.getCharArray(), dst.getCharArray());
#else
String command = "ln -s " + String::DQuotes(src) + " " + String::DQuotes(dst);
int i = system(command.getCharArray());
//printf("cp '%s' return code = %d\n",src.getCharArray(), i);
#endif
}
static void CopyDirectory(const String& src, const String& dst) {
#if __cplusplus >= 201703L
std::filesystem::copy((src+ "/.").getCharArray(), dst.getCharArray(), std::filesystem::copy_options::recursive);

View File

@@ -1 +1 @@
5
6