Changes

Jump to navigation Jump to search
585 bytes removed ,  00:42, 26 May 2012
m
Text replace - "| valign='top' | " to "| "
|<code><b>$file:directory-separator</b> as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|This variable returns the directory separator used by the operating system, such as "/" or "\".<br />
|}
|<code><b>$file:path-separator</b> as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|This variable returns the path separator used by the operating system, such as ";" or ":".<br />
|}
|<code><b>file:exists</b>($path as xs:string) as xs:boolean</code><br />
|-
| valign='top' | '''Summary'''
|Returns an <code>xs:boolean</code> indicating whether a file or directory specified by <code>$path</code> exists in the file system.<br />
|}
|<code><b>file:is-directory</b>($path as xs:string) as xs:boolean</code><br />
|-
| valign='top' | '''Summary'''
|Returns an <code>xs:boolean</code> indicating whether the argument <code>$path</code> points to an existing directory.<br />
|}
|<code><b>file:is-file</b>($path as xs:string) as xs:boolean</code><br />
|-
| valign='top' | '''Summary'''
|Returns an <code>xs:boolean</code> indicating whether the argument <code>$path</code> points to an existing file.<br />
|}
|<code><b>file:last-modified</b>($path as xs:string) as xs:dateTime</code><br />
|-
| valign='top' | '''Summary'''
|Retrieves the timestamp of the last modification of the file or directory specified by <code>$path</code>.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0001]]</b> is raised if the specified path does not exist.<br />
|}
|<code><b>file:size</b>($file as xs:string) as xs:integer</code><br />
|-
| valign='top' | '''Summary'''
|Returns the size, in bytes, of the file specified by <code>$path</code>.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0001]]</b> is raised if the specified file does not exist.<br /><b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified file points to a directory.<br />
|}
|<code><b>file:base-name</b>($path as xs:string) as xs:string</code><br /><code><b>file:base-name</b>($path as xs:string, $suffix as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Returns the base-name of the path specified by <code>$path</code>, which is the component after the last directory separator.<br />If <code>$suffix</code> is specified, it will be trimmed from the end of the result.<br />
|}
|<code><b>file:dir-name</b>($path as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Returns the parent directory of the path specified by <code>$path</code>, which is the component before the last directory separator.<br />
|}
|<code><b>file:path-to-native</b>($path as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Transforms the <code>$path</code> argument to its native representation on the operating system.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the specified path cannot be transformed to its native representation.<br />
|}
|<code><b>file:resolve-path</b>($path as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Transforms the <code>$path</code> argument to an absolute operating system path.<br />
|}
|<code><b>file:path-to-uri</b>($path as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Transforms the path specified by <code>$path</code> into a URI with the <code>file://</code> scheme.<br />
|}
|<code><b>file:list</b>($directory as xs:string) as xs:string*</code><br /><code><b>file:list</b>($directory as xs:string, $recursive as xs:boolean) as xs:string*</code><br /><code><b>file:list</b>($directory as xs:string, $recursive as xs:boolean, $pattern as xs:string) as xs:string*</code><br />
|-
| 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 sub-directories will be traversed, 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'''
|<b>[[XQuery Errors#File Module Errors|FOFL0003]]</b> is raised if the specified path does not point to a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:create-directory</b>($directory as xs:string) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Recursively creates the directories specified by <code>$directory</code>.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0002]]</b> is raised if a file with the same path already exists.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<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 path does not exist.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:read-text</b>($path as xs:string) as xs:string</code><br /><code><b>file:read-text</b>($path as xs:string, $encoding as xs:string) as xs:string</code><br />
|-
| valign='top' | '''Summary'''
|Reads the textual contents of the file specified by <code>$path</code> and returns it as a <code>xs:string</code>.<br />The optional parameter <code>$encoding</code> defines the encoding of the file.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0001]]</b> is raised if the specified file does not exist.<br /><b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0005]]</b> is raised if the specified encoding is not supported, or unknown.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:read-text-lines</b>($path as xs:string) as xs:string</code><br /><code><b>file:read-text-lines</b>($path as xs:string, $encoding as xs:string) as xs:string*</code><br />
|-
| valign='top' | '''Summary'''
|Reads the textual contents of the file specified by <code>$path</code> and returns it as a sequence of <code>xs:string</code> items.<br />The optional parameter <code>$encoding</code> defines the encoding of the file.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0001]]</b> is raised if the specified file does not exist.<br /><b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0005]]</b> is raised if the specified encoding is not supported, or unknown.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:read-binary</b>($path as xs:string) as xs:base64Binary</code><br />
|-
| valign='top' | '''Summary'''
|Reads the binary content of the file specified by <code>$path</code> and returns as a <code>xs:base64Binary</code>.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0001]]</b> is raised if the specified file does not exist.<br /><b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:write</b>($path as xs:string, $items as item()*) as empty-sequence()</code><br /><code><b>file:write</b>($path as xs:string, $items as item()*, $params as xs:node()*) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Writes a sequence of <code>$items</code> to a file specified by <code>$path</code>. If the specified file already exists, it will be overwritten.<br />The optional argument <code>$params</code> is used to set the serialization parameters (see [[Serialization]] for more details).It can be specified as<br />
* <code>element(serialization-parameters)</code>: <code>&lt;serialization-parameters/&gt;</code> must be used as root element, and the parameters are specified as child nodes, with the element name representing the serialization parameter and the attribute <code>value</code> representing its value:<br /><code>&lt;serialization-parameters xmlns="http://www.w3.org/2010/xslt-xquery-serialization"&gt;<br/>&nbsp;&nbsp;&lt;method value='xml'/&gt;<br/>&nbsp;&nbsp;&lt;cdata-section-elements value="div"/&gt;<br/>&nbsp;&nbsp;...<br/>&lt;/serialization-parameters&gt;</code>
* [[Map Module|map structure]]: all parameters can be directly represented as key/value pairs:<br /><code>map { "method" := "xml", "cdata-section-elements" := "div", ... </code>}<br/>
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:write-binary</b>($path as xs:string, $items as xs:base64Binary*) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Writes a sequence of <code>xs:basex64Binary</code> <code>$items</code> to a file specified by <code>$path</code>. If the specified file already exists, it will be overwritten.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:append</b>($path as xs:string, $items as item()*) as empty-sequence()</code><br /><code><b>file:append</b>($path as xs:string, $items as item()*, $params as xs:node()*) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Appends a sequence of <code>$items</code> to a file specified by <code>$path</code>. If the specified file does not exists, a new file is created.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:append-binary</b>($path as xs:string, $items as xs:base64Binary*) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Appends a sequence of <code>xs:basex64Binary</code> <code>$items</code> to a file specified by <code>$path</code>. If the specified file does not exists, a new file is created.<br />
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#File Module Errors|FOFL0004]]</b> is raised if the specified path is a directory.<br /><b>[[XQuery Errors#File Module Errors|FOFL0000]]</b> is raised if the operation fails for some other reason.<br />
|}
|<code><b>file:copy</b>($source as xs:string, $target as xs:string) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Copies a file specified by <code>$source</code> to the file or directory specified by <code>$target</code>. If the target represents an existing file, it will be overwritten. No operation will be performed if the source and target path are equal.<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 />
|}
|<code><b>file:move</b>($source as xs:string, $target as xs:string) as empty-sequence()</code><br />
|-
| valign='top' | '''Summary'''
|Moves or renames the file or directory specified by <code>$source</code> to the path specified by <code>$target</code>. No operation will be performed if the source and target path are equal.<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 />
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu