X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/093b834960aa7457d220feacad9542c4606ed8a0..cb384017166c74fdfd75b07c8a80b1af46c9447d:/src/surf/FileImpl.cpp diff --git a/src/surf/FileImpl.cpp b/src/surf/FileImpl.cpp index fbb70a7e8f..ff0a830369 100644 --- a/src/surf/FileImpl.cpp +++ b/src/surf/FileImpl.cpp @@ -92,23 +92,23 @@ int FileImpl::unlink() } } -void FileImpl::move(const char* fullpath) +void FileImpl::move(std::string fullpath) { /* Check if the new full path is on the same mount point */ - if (not strncmp(mount_point_.c_str(), fullpath, mount_point_.size())) { + if (not strncmp(mount_point_.c_str(), fullpath.c_str(), mount_point_.size())) { std::map* content = location_->getContent(); auto sz = content->find(path_); if (sz != content->end()) { // src file exists sg_size_t new_size = sz->second; content->erase(path_); - std::string path = std::string(fullpath).substr(mount_point_.size(), strlen(fullpath)); + std::string path = fullpath.substr(mount_point_.length(), fullpath.length()); content->insert({path.c_str(), new_size}); - XBT_DEBUG("Move file from %s to %s, size '%llu'", path_.c_str(), fullpath, new_size); + XBT_DEBUG("Move file from %s to %s, size '%llu'", path_.c_str(), fullpath.c_str(), new_size); } else { XBT_WARN("File %s doesn't exist", path_.c_str()); } } else { - XBT_WARN("New full path %s is not on the same mount point: %s.", fullpath, mount_point_.c_str()); + XBT_WARN("New full path %s is not on the same mount point: %s.", fullpath.c_str(), mount_point_.c_str()); } } }