DirectoryNodeTree

DIRAC FileCatalog component representing a directory tree with simple nodes

class DIRAC.DataManagementSystem.DB.FileCatalogComponents.DirectoryManager.DirectoryNodeTree.DirectoryNodeTree(database=None)

Bases: DIRAC.DataManagementSystem.DB.FileCatalogComponents.DirectoryManager.DirectoryTreeBase.DirectoryTreeBase

Class managing Directory Tree as a self-linked structure with directory names stored in each node

__init__(database=None)
changeDirectoryGroup(paths, recursive=False)

Bulk setting of the directory group

Parameters

paths (dictionary) – dictionary < lfn : group >

changeDirectoryMode(paths, recursive=False)

Bulk setting of the directory mode

Parameters

paths (dictionary) – dictionary < lfn : mode >

changeDirectoryOwner(paths, recursive=False)

Bulk setting of the directory owner

Parameters

paths (dictionary) – dictionary < lfn : owner >

countSubdirectories(dirId, includeParent=True)
createDirectory(dirs, credDict)

Checking for existence of directories

exists(lfns)
existsDir(path)

Check the existence of a directory at the specified path

findDir(path)

Find the identifier of a directory specified by its path

findDirs(paths, connection=False)

Find DirIDs for the given path list

getChildren(path)

Get child directory IDs for the given directory

getDirectoryCounters(connection=False)

Get the total number of directories

getDirectoryName(dirID)

Get directory name by directory ID

getDirectoryParameters(path)

Get the given directory parameters

getDirectoryPath(dirID)

Get directory path by directory ID

getDirectoryPermissions(path, credDict)

Get permissions for the given user/group to manipulate the given directory

getDirectoryReplicas(lfns, allStatus=False)

Get replicas for files in the given directories

getDirectorySize(lfns, longOutput=False, rawFileTables=False, recursiveSum=True)

Get the total size of the requested directories. If longOutput flag is True, get also physical size per Storage Element

Parameters
  • longOutput (bool) – if True, also fetches the physical size per SE

  • rawFileTables (bool) – if True, uses the File table instead of the pre-computed values

  • recursiveSum (bool) – if True (default), takes into account subdirectories

getFileIDsInDirectoryWithLimits(dirID, credDict, startItem=1, maxItems=25)

Get file IDs for the given directory

getFileLFNsInDirectory(dirID, credDict)

Get file lfns for the given directory or directory list

getFileLFNsInDirectoryByDirectory(dirIDList, credDict)

Get file LFNs and IDs for the given directory or directory list

Parameters
  • dirIDList (list) – List of directory IDs

  • credDict (dict) – dictionary of user credentials

Returns

S_OK/S_ERROR with Value dictionary {“DirLFNDict”: dirLfnDict, “IDLFNDict”: idLfnDict} where dirLfnDict has the structure <directory_name>:<list of contained file names>, idLfnDict has structure <fileID>:<LFN>

getParent(path)

Get the parent ID of the given directory

getParentID(dirID)
getPathIDs(path)

Get IDs of all the directories in the parent hierarchy

getPathPermissions(lfns, credDict)

Get permissions for the given user/group to manipulate the given lfns

getSubdirectoriesByID(dirID, requestString=False, includeParent=False)

Get all the subdirectories of the given directory at a given level

getTreeTable()

Get the string of the Directory Tree type

isDirectory(paths)

Checking for existence of directories

isEmpty(path)

Find out if the given directory is empty

listDirectory(lfns, verbose=False)

Get the directory listing

makeDir(path)

Create a single directory

makeDirectories(path, credDict)

Make all the directories recursively in the path. The return value is the dictionary containing all the parameters of the newly created directory

makeDirectory(path, credDict, status=0)

Create a new directory. The return value is the dictionary containing all the parameters of the newly created directory

removeDir(path)
removeDirectory(dirs, force=False)

Remove an empty directory from the catalog

setDatabase(database)
setDirectoryStatus(path, status)

set the directory status