Loading TOC...


   $pathname as xs:string
) as element(dir:directory)


Performs a directory listing of the given file pathname.

$pathname Pathname of the directory to be listed.

Required Privileges


Usage Notes

The user under which MarkLogic Server is running must have permissions to read the specified directory. For example, on Windows systems, MarkLogic Server typically runs as the SYSTEM user, and therefore the SYSTEM user must have permissions to read the directory (even a mapped network drive directory). Similarly, on UNIX systems, MarkLogic Server typically runs as the daemon user, and that user needs to have read permission to the specified directory. If the user in which MarkLogic Server runs does not have the needed permissions, then an error such as SVC-DIROPEN or SVC-FILOPN is thrown when you attempt to call this built-in.


   xsi:schemaLocation="http://marklogic.com/xdmp/directory directory.xsd">

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.


The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • If the directory does not exist, a SVC-DIROPEN error will be thrown. xdmp:filesystem-file-exists can be used to check for existence before attempting to get the directory when there is a possibility of the directory not existing.