Commit 9d379229 authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Fixed bug with getting Dir entries

parent 6a577e60
......@@ -605,6 +605,7 @@ cta::ArchiveDirEntry cta::MockNameServer::getArchiveDirEntry(
const std::string name = Utils::getEnclosedName(path);
ArchiveDirEntry::EntryType entryType;
std::string storageClassName;
std::list<NameServerTapeFile> tapeCopies;
if(S_ISDIR(statResult.st_mode)) {
entryType = ArchiveDirEntry::ENTRYTYPE_DIRECTORY;
......@@ -612,6 +613,7 @@ cta::ArchiveDirEntry cta::MockNameServer::getArchiveDirEntry(
} else if(S_ISREG(statResult.st_mode)) {
entryType = ArchiveDirEntry::ENTRYTYPE_FILE;
storageClassName = getDirStorageClass(requester, enclosingPath);
tapeCopies = getTapeFiles(requester, path);
} else {
std::ostringstream msg;
msg << "statFile() - " << m_fsDir+path <<
......@@ -624,7 +626,6 @@ cta::ArchiveDirEntry cta::MockNameServer::getArchiveDirEntry(
const uint64_t size = 1234;
ArchiveFileStatus status(owner, statResult.st_mode, size, checksum,
storageClassName);
const std::list<NameServerTapeFile> tapeCopies = getTapeFiles(requester, path);
return ArchiveDirEntry(entryType, name, status, tapeCopies);
}
......
......@@ -1169,9 +1169,9 @@ void XrdProFile::xCom_ls(const std::vector<std::string> &tokens, const cta::Secu
<< " " << owner.uid
<< " " << owner.gid
<< " " << storageClassName
<< " " << dirEntry.name
<< " " << dirEntry.status.checksum.str()
<< " " << dirEntry.status.size << std::endl;
<< " " << dirEntry.status.size
<< " " << dirEntry.name << std::endl;
for(auto i=dirEntry.tapeCopies.begin(); i!=dirEntry.tapeCopies.end(); i++) {
responseSS << " " << i->tapeFileLocation.copyNb
<< " " << i->tapeFileLocation.vid
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment