Loading TOC...

MarkLogic 10 Product Documentation
xdmp.filesystemDirectory

xdmp.filesystemDirectory(
   pathname as String
) as Array

Summary

Performs a directory listing of the given file pathname.

Parameters
pathname Pathname of the directory to be listed.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-filesystem-directory

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.

Example

xdmp.filesystemDirectory("/etc");
=>
[
  {
    "filename":"rpm",
    "pathname":"/etc/rpm",
    "type":"directory",
    "contentLength":4096,
    "lastModified":"2014-10-24T23:25:00"
  },
  {
    "filename":"sudoers.d",
    "pathname":"/etc/sudoers.d",
    "type":"directory",
    "contentLength":4096,
    "lastModified":"2013-09-30T22:36:00"
  },
    ...
]

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