<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.filesystemDirectory.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.filesystemDirectory</api:function-name><api:suggest>xdmp.filesystemdirectory</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>filesystemdirectory</api:suggest><api:function-link mode="xquery" fullname="xdmp:filesystem-directory">/apidoc/8.0/xdmp:filesystem-directory.xml</api:function-link><api:function mode="javascript" name="filesystemDirectory" type="builtin" lib="xdmp" category="AdminBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.filesystemDirectory"><api:summary>
  Performs a directory listing of the given file pathname.
</api:summary><api:params><api:param name="pathname" type="xs:string"><api:param-description>
    Pathname of the directory to be listed.
  </api:param-description><api:param-name>pathname</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return class="javascript">Array</api:return><api:privilege>
  <p xmlns="http://www.w3.org/1999/xhtml"><code>http://marklogic.com/xdmp/privileges/xdmp-filesystem-directory</code></p>
</api:privilege><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">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-FILOPEN is thrown when you
  attempt to call this built-in.</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.filesystemDirectory("/etc");
=&gt;
[
  {
    "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"
  },
    ...
]
</pre></api:example></api:function></api:function-page>