Changes

Jump to navigation Jump to search
374 bytes added ,  14:11, 10 February 2023
Function file:move - added an example how to rename a file.
| '''Errors'''
|{{Error|not-found|#Errors}} the specified source does not exist.<br />{{Error|exists|#Errors}} the specified source is a directory and the target is a file.<br />{{Error|no-dir|#Errors}} the parent of the specified target is no directory.<br />{{Error|io-error|#Errors}} the operation fails for some other reason.<br />
|- valign="top"
| '''Examples'''
|When renaming a file, remember that relative file paths are resolved against the current working directory. Some ways to rename:
<syntaxhighlight lang="xquery">
file:move('/projects/new/octopus', '/projects/new/septimus')
</syntaxhighlight>
<syntaxhighlight lang="xquery">
$path ! file:move(., file:parent(.)||$newName)
</syntaxhighlight>
 
|}
administrator, editor
2

edits

Navigation menu