Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
handle special case of '/' as mount point
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 12 Sep 2019 11:34:12 +0000 (13:34 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 12 Sep 2019 11:34:12 +0000 (13:34 +0200)
src/plugins/file_system/s4u_FileSystem.cpp

index e9aeb84..2b88d16 100644 (file)
@@ -68,7 +68,11 @@ File::File(const std::string& fullpath, sg_host_t host, void* userdata) : fullpa
         }
         if (longest_prefix_length > 0) { /* Mount point found, split fullpath_ into mount_name and path+filename*/
           mount_point_ = fullpath_.substr(0, longest_prefix_length);
         }
         if (longest_prefix_length > 0) { /* Mount point found, split fullpath_ into mount_name and path+filename*/
           mount_point_ = fullpath_.substr(0, longest_prefix_length);
-          path_        = fullpath_.substr(longest_prefix_length, fullpath_.length());
+          if (mount_point_ == std::string("/"))
+            path_ = fullpath_;
+          else
+            path_ = fullpath_.substr(longest_prefix_length, fullpath_.length());
+          XBT_DEBUG("%s + %s", mount_point_.c_str(), path_.c_str());
         } else
           xbt_die("Can't find mount point for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
       }
         } else
           xbt_die("Can't find mount point for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
       }