|-
| valign='top' | '''Summary'''
|Lists all files and directories found in the specified <code>$directory</code>. The returned paths are relative to the provided path.<br />The optional parameter <code>$recursive</code> specifies whether the sub-directories are to will be recursed as welltraversed, too.<br />The optional parameter <code>$pattern</code> defines a file name pattern in the [http://en.wikipedia.org/wiki/Glob_(programming) glob syntax]. If present, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma (<code>,</code>).<br />
|-
| valign='top' | '''Errors'''
==file:delete==
{{Mark|Updated with Version 7.2.1:}} {{Mono|$recursive}} parameter added to prevent sub-directories to be accidentally deleted.
{|
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>file:delete</b>($path as xs:string) as empty-sequence()</code><br /><code><b>file:delete</b>($path as xs:string, $recursive as xs:boolean) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Recursively deletes a file or directory specified by <code>$path</code>.<br />The optional parameter <code>$recursive</code> specifies whether sub-directories will be deleted, too.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0001]]</b> is raised if the specified source does not exist.<br /><b>[[XQuery Errors#File Module Errors|FOFL0002]]</b> is raised if the specified source is a directory and the target is a file.<br /><b>[[XQuery Errors#File Module Errors|FOFL0003]]</b> is raised if the parent of the specified target is no directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
=Changelog=
===Version 7.2.1===
* Updated: [[#file:delete|file:delete]]: {{Mono|$recursive}} parameter added to prevent sub-directories to be accidentally deleted.
[[Category:XQuery]]