Changes

Jump to navigation Jump to search
69 bytes added ,  07:31, 5 June 2012
no edit summary
|}
=Reading Functions=
==file:existslist==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:existslist|$path dir as xs:string|xs:string*}}<br />{{Func|file:list|$dir as xs:string, $recursive as xs:boolean|xs:string*}}<br />{{Func|file:list|$dir as xs:string, $recursive as xs:boolean, $pattern as xs:string|xs:string*}}<br />
|-
| '''Summary'''
|Returns an Lists all files and directories found in the specified {{Code|xs:boolean$dir}}. The returned paths are relative to the provided path.<br />The optional parameter {{Code|$recursive}} indicating specifies whether sub-directories will be traversed, too.<br />The optional parameter {{Code|$pattern}} defines a file or directory specified by 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|$,}}).<br />|-| '''Errors'''|{{Error|FILE0003|#Errors}} the specified pathdoes not point to a directory.<br />{{Error|FILE9999|#Errors}} exists in the file systemoperation fails for some other reason.<br />
|}
==file:isread-dirtext==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:isread-dirtext|$path as xs:string|xs:booleanstring}}<br />{{Func|file:read-text|$path as xs:string, $encoding as xs:string|xs:string}}<br />
|-
| '''Summary'''
|Returns an Reads the textual contents of the file specified by {{Code|$path}} and returns it as {{Code|xs:booleanstring}} indicating whether the argument .<br />The optional parameter {{Code|$encoding}} defines the encoding of the file.<br />|-| '''Errors'''|{{Error|FILE0001|#Errors}} the specified file does not exist.<br />{{Error|FILE0004|#Errors}} the specified pathis a directory.<br />{{Error|FILE0005|#Errors}} points to an existing directorythe specified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:isread-filetext-lines==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:isread-text-lines|$path as xs:string|xs:string}}<br />{{Func|file:read-text-lines|$path as xs:string, $encoding as xs:string|xs:booleanstring*}}<br />
|-
| '''Summary'''
|Returns an Reads the textual contents of the file specified by {{Code|$path}} and returns it as a sequence of {{Code|xs:booleanstring}} indicating whether the argument items.<br />The optional parameter {{Code|$encoding}} defines the encoding of the file.<br />|-| '''Errors'''|{{Error|FILE0001|#Errors}} the specified file does not exist.<br />{{Error|FILE0004|#Errors}} the specified pathis a directory.<br />{{Error|FILE0005|#Errors}} the specified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} points to an existing filethe operation fails for some other reason.<br />
|}
==file:lastread-modifiedbinary==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:lastread-modifiedbinary|$path as xs:string|xs:dateTimebase64Binary}}<br />
|-
| '''Summary'''
|Retrieves Reads the timestamp of the last modification binary content of the file or directory specified by {{Code|$path}} and returns it as {{Code|xs:base64Binary}}.<br />
|-
| '''Errors'''
|{{Error|FILE0001|#Errors}} the specified path file does not exist.<br />{{Error|FILE0004|#Errors}} the specified path is a directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
=Writing Functions= ==file:sizecreate-dir==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:sizecreate-dir|$file dir as xs:string|xs:integerempty-sequence()}}<br />
|-
| '''Summary'''
|Returns Recursively creates the size, in bytes, of the file directories specified by {{Code|$pathdir}}.<br />
|-
| '''Errors'''
|{{Error|FILE0001FILE0002|#Errors}} a file with the specified file does not existsame path already exists.<br />{{Error|FILE0004FILE9999|#Errors}} the specified file points to a directoryoperation fails for some other reason.<br />
|}
==file:base-namedelete=={{Mark|Updated with Version 7.2.1:}} {{Code|$recursive}} parameter added to prevent sub-directories from being accidentally deleted.
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:base-namedelete|$path as xs:string|xs:stringempty-sequence()}}<br />{{Func|file:base-namedelete|$path as xs:string, $suffix recursive as xs:stringboolean|xs:stringempty-sequence()}}<br />
|-
| '''Summary'''
|Returns the base-name of the path Recursively deletes a file or directory specified by {{Code|$path}}, which is the component after the last directory separator.<br />If The optional parameter {{Code|$suffixrecursive}} is specified, it specifies whether sub-directories will be trimmed from deleted, too.<br />|-| '''Errors'''|{{Error|FILE0001|#Errors}} the end of specified path does not exist.<br />{{Error|FILE9999|#Errors}} the resultoperation fails for some other reason.<br />
|}
==file:dir-namewrite==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:dir-namewrite|$path as xs:string, $items as item()*|empty-sequence()}}<br />{{Func|file:write|$path as xs:string, $items as item()*, $params as item()|empty-sequence()}}<br />
|-
| '''Summary'''
|Returns the parent directory Writes a sequence of the path {{Code|$items}} to a file specified by {{Code|$path}}. If the specified file already exists, which it will be overwritten.<br />The optional argument {{Code|$params}} is used to set the serialization parameters (see [[Serialization]] for more details).It can be specified as<br />* {{Code|element(serialization-parameters)}}: {{Code|&lt;serialization-parameters/&gt;}} 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}} 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/>|-| '''Errors'''|{{Error|FILE0003|#Errors}} the component before parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} the last specified path is a directory separator.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:pathwrite-to-nativebinary==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:path-towrite-nativebinary|$path as xs:string|, $items as xs:stringbase64Binary*|empty-sequence()}}<br />
|-
| '''Summary'''
|Transforms the Writes a sequence of Base64 {{Code|$items}} to a file specified by {{Code|$path}} argument to its native representation on . If the operating systemspecified file already exists, it will be overwritten.<br />
|-
| '''Errors'''
|{{Error|FILE9999FILE0003|#Errors}} the parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} the specified path cannot be transformed to its native representationis a directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:resolvewrite-pathtext== {{Mark|Added with Version 7.3:}} 
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:resolvewrite-text|$pathas xs:string, $items as xs:string*|empty-sequence()}}<br />{{Func|file:write-text|$path as xs:string|, $items as xs:string*, $encoding as xs:string|empty-sequence()}}<br />
|-
| '''Summary'''
|Transforms Writes a sequence of string {{Code|$items}} to a file specified by {{Code|$path}}. If the specified file already exists, it will be overwritten.<br />The optional parameter {{Code|$encoding}} defines the output encoding (default: UTF-8).<br />|-| '''Errors'''|{{Error|FILE0003|#Errors}} the parent of specified pathis no directory.<br />{{Error|FILE0004|#Errors}} argument to an absolute operating system the specified pathis a directory.<br />{{Error|FILE0005|#Errors}} the specified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:path-to-uriappend==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:path-to-uriappend|$path as xs:string, $items as item()*|empty-sequence()}}<br />{{Func|file:append|$path as xs:string, $items as item()*, $params as item()|empty-sequence()}}<br />
|-
| '''Summary'''
|Transforms the path Appends a sequence of {{Code|$items}} to a file specified by {{Code|$path}} into . If the specified file does not exists, a URI with new file is created.<br />|-| '''Errors'''|{{Error|FILE0003|#Errors}} the parent of specified path is no directory.<br />{{CodeError|FILE0004|file:/#Errors}} the specified path is a directory.<br />{{Error|FILE9999|#Errors}} schemethe operation fails for some other reason.<br />
|}
==file:listappend-binary==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:listappend-binary|$dir as xs:string|xs:string*}}<br />{{Func|file:list|$dir path as xs:string, $recursive items as xs:boolean|xsbasex:stringbinary*}}<br />{{Func|file:list|$dir as xs:string, $recursive as xs:boolean, $pattern as xs:string|xs:string*empty-sequence()}}<br />
|-
| '''Summary'''
|Lists all files and directories found in the specified Appends a sequence of binary {{Code|$diritems}}. The returned paths are relative to the provided path.<br />The optional parameter a file specified by {{Code|$recursivepath}} specifies whether sub-directories will be traversed, too.<br />The optional parameter {{Code|$pattern}} defines a If the specified file name pattern in the [http://en.wikipedia.org/wiki/Glob_(programming) glob syntax]. If presentdoes not exists, only those files and directories are returned that correspond to the pattern. Several patterns can be separated with a comma ({{Code|,}})new file is created.<br />
|-
| '''Errors'''
|{{Error|FILE0003|#Errors}} the parent of specified path does not point to is no directory.<br />{{Error|FILE0004|#Errors}} the specified path is a directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:createappend-dirtext== {{Mark|Added with Version 7.3:}} 
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:createappend-dirtext|$dir path as xs:string, $items as xs:string*|empty-sequence()}}<br />{{Func|file:append-text|$path as xs:string, $items as xs:string*, $encoding as xs:string|empty-sequence()}}<br />
|-
| '''Summary'''
|Recursively creates Appends a sequence of string {{Code|$items}} to a file specified by {{Code|$path}}. If the directories specified by file does not exists, a new file is created.<br />The optional parameter {{Code|$direncoding}}defines the output encoding (default: UTF-8).<br />
|-
| '''Errors'''
|{{Error|FILE0002FILE0003|#Errors}} the parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} the specified path is a file with directory.<br />{{Error|FILE0005|#Errors}} the same path already existsspecified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:deletecopy=={{Mark|Updated with Version 7.2.1:}} {{Code|$recursive}} parameter added to prevent sub-directories from being accidentally deleted.
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:deletecopy|$path source as xs:string|empty-sequence()}}<br />{{Func|file:delete|, $path target as xs:string, $recursive as xs:boolean|empty-sequence()}}<br />
|-
| '''Summary'''
|Recursively deletes Copies a file or directory specified by {{Code|$pathsource}}.<br />The optional parameter to the file or directory specified by {{Code|$recursivetarget}} specifies whether sub-directories . If the target represents an existing file, it will be overwritten. No operation will be deleted, tooperformed if the source and target path are equal.<br />
|-
| '''Errors'''
|{{Error|FILE0001|#Errors}} the specified path source does not exist.<br />{{Error|FILE0002|#Errors}} the specified source is a directory and the target is a file.<br />{{Error|FILE0003|#Errors}} the parent of the specified target is no directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:read-textmove==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:read-text|$path as xs:string|xs:string}}<br />{{Func|file:read-textmove|$path source as xs:string, $encoding target as xs:string|xs:stringempty-sequence()}}<br />
|-
| '''Summary'''
|Reads the textual contents of Moves or renames the file or directory specified by {{Code|$pathsource}} and returns it as to the path specified by {{Code|xs:string$target}}.<br />The optional parameter {{Code|$encoding}} defines No operation will be performed if the encoding of the filesource and target path are equal.<br />
|-
| '''Errors'''
|{{Error|FILE0001|#Errors}} the specified file source does not exist.<br />{{Error|FILE0004FILE0002|#Errors}} the specified path source is a directoryand the target is a file.<br />{{Error|FILE0005FILE0003|#Errors}} the parent of the specified encoding target is not supported, or unknownno directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
=Property Functions= ==file:read-text-linesexists==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:read-text-linesexists|$path as xs:string|xs:string}}<br />{{Func|file:read-text-lines|$path as xs:string, $encoding as xs:string|xs:string*boolean}}<br />
|-
| '''Summary'''
|Reads the textual contents of the file specified by {{Code|$path}} and returns it as a sequence of Returns an {{Code|xs:stringboolean}} items.<br />The optional parameter indicating whether a file or directory specified by {{Code|$encodingpath}} defines the encoding of exists in the file.<br />|-| '''Errors'''|{{Error|FILE0001|#Errors}} the specified file does not exist.<br />{{Error|FILE0004|#Errors}} the specified path is a directory.<br />{{Error|FILE0005|#Errors}} the specified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reasonsystem.<br />
|}
==file:readis-binarydir==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:readis-binarydir|$path as xs:string|xs:base64Binaryboolean}}<br />
|-
| '''Summary'''
|Reads the binary content of the file specified by {{Code|$path}} and returns it as Returns an {{Code|xs:base64Binary}}.<br />|-| '''Errors'''|{{Error|FILE0001|#Errorsboolean}} indicating whether the specified file does not exist.<br />argument {{ErrorCode|FILE0004|#Errors$path}} the specified path is a points to an existing directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:writeis-file==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:writeis-file|$path as xs:string, $items as item()*|empty-sequence()}}<br />{{Func|file:write|$path as xs:string, $items as item()*, $params as item()|empty-sequence()boolean}}<br />
|-
| '''Summary'''
|Writes a sequence of Returns an {{Code|$itemsxs:boolean}} to a file specified by {{Code|$path}}. If indicating whether the specified file already exists, it will be overwritten.<br />The optional argument {{Code|$paramspath}} is used points to set the serialization parameters (see [[Serialization]] for more details).It can be specified as<br />* {{Code|element(serialization-parameters)}}: {{Code|&lt;serialization-parameters/&gt;}} 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}} 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/>|-| '''Errors'''|{{Error|FILE0003|#Errors}} the parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} the specified path is a directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reasonan existing file.<br />
|}
==file:writelast-binarymodified==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:writelast-binarymodified|$path as xs:string, $items as |xs:base64Binary*|empty-sequence()dateTime}}<br />
|-
| '''Summary'''
|Writes a sequence Retrieves the timestamp of the last modification of Base64 {{Code|$items}} to a the file or directory specified by {{Code|$path}}. If the specified file already exists, it will be overwritten.<br />
|-
| '''Errors'''
|{{Error|FILE0003FILE0001|#Errors}} the parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} the specified path is a directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reasondoes not exist.<br />
|}
==file:write-textsize== {{Mark|Added with Version 7.3:}} 
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:write-textsize|$path as xs:string, $items file as xs:string*|empty-sequence()}}<br />{{Func|file:write-text|$path as xs:string, $items as xs:string*, $encoding as xs:string|empty-sequence()integer}}<br />
|-
| '''Summary'''
|Writes a sequence Returns the size, in bytes, of string {{Code|$items}} to a the file specified by {{Code|$path}}. If the specified file already exists, it will be overwritten.<br />The optional parameter {{Code|$encoding}} defines the output encoding (default: UTF-8).<br />
|-
| '''Errors'''
|{{Error|FILE0003FILE0001|#Errors}} the parent of specified path is no directoryfile does not exist.<br />{{Error|FILE0004|#Errors}} the specified path is file points to a directory.<br />{{Error|FILE0005|#Errors}} the specified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
=Path Functions= ==file:appendbase-name==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:appendbase-name|$path as xs:string, $items as item()*|empty-sequence()xs:string}}<br />{{Func|file:appendbase-name|$path as xs:string, $items suffix as item()*, $params as item()xs:string|empty-sequence()xs:string}}<br />
|-
| '''Summary'''
|Appends a sequence Returns the base-name of {{Code|$items}} to a file the path specified by {{Code|$path}}. If the specified file does not exists, a new file which is created.<br />|-| '''Errors'''|{{Error|FILE0003|#Errors}} the parent of specified path is no component after the last directoryseparator.<br />If {{ErrorCode|FILE0004|#Errors$suffix}} is specified, it will be trimmed from the specified path is a directory.<br />{{Error|FILE9999|#Errors}} end of the operation fails for some other reasonresult.<br />
|}
==file:appenddir-binaryname==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:appenddir-binaryname|$path as xs:string, $items as basex|xs:binary*|empty-sequence()string}}<br />
|-
| '''Summary'''
|Appends a sequence Returns the parent directory of binary {{Code|$items}} to a file the path specified by {{Code|$path}}. If the specified file does not exists, a new file which is created.<br />|-| '''Errors'''|{{Error|FILE0003|#Errors}} the parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} component before the specified path is a last directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reasonseparator.<br />
|}
==file:appendpath-textto-native== {{Mark|Added with Version 7.3:}} 
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:append-text|$path as xs:string, $items as xs:string*|empty-sequence()}}<br />{{Func|file:appendto-textnative|$path as xs:string, $items as xs:string*, $encoding as |xs:string|empty-sequence()}}<br />
|-
| '''Summary'''
|Appends a sequence of string Transforms the {{Code|$itemspath}} argument to a file specified by {{Code|$path}}. If the specified file does not exists, a new file is created.<br />The optional parameter {{Code|$encoding}} defines its native representation on the output encoding (default: UTF-8)operating system.<br />
|-
| '''Errors'''
|{{Error|FILE0003FILE9999|#Errors}} the parent of specified path is no directory.<br />{{Error|FILE0004|#Errors}} the specified path is a directory.<br />{{Error|FILE0005|#Errors}} the specified encoding is not supported, or unknown.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reasoncannot be transformed to its native representation.<br />
|}
==file:copyresolve-path==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:copyresolve-path|$source path as xs:string, $target as |xs:string|empty-sequence()}}<br />
|-
| '''Summary'''
|Copies a file specified by Transforms the {{Code|$sourcepath}} argument to the file or directory specified by {{Code|$target}}. If the target represents an existing file, it will be overwritten. No operation will be performed if the source and target absolute operating system path are equal.<br />|-| '''Errors'''|{{Error|FILE0001|#Errors}} the specified source does not exist.<br />{{Error|FILE0002|#Errors}} the specified source is a directory and the target is a file.<br />{{Error|FILE0003|#Errors}} the parent of the specified target is no directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reason.<br />
|}
==file:movepath-to-uri==
{|
|-
| width='90' | '''Signatures'''
|{{Func|file:movepath-to-uri|$source path as xs:string, $target as |xs:string|empty-sequence()}}<br />
|-
| '''Summary'''
|Moves or renames the file or directory specified by {{Code|$source}} to Transforms the path specified by {{Code|$target}}. No operation will be performed if the source and target path are equal.<br />|-| '''Errors'''|{{Error|FILE0001|#Errors}} into a URI with the specified source does not exist.<br />{{Error|FILE0002Code|#Errors}} the specified source is a directory and the target is a file.<br :/>{{Error|FILE0003|#Errors}} the parent of the specified target is no directory.<br />{{Error|FILE9999|#Errors}} the operation fails for some other reasonscheme.<br />
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu