The package file provides the necessary functions to treat files from XSQL-Script. Files can be created, removed, edited, read them, stored in the database...
The following table shows the most important functions, separateds by differents aspects as: Binary or Character functions. Functions which reference a file via
an identifier or directly through an argument in which is passed the file. Functions to which you can indicate the character set and to which you cannot.
1 Xsql file
Character | Binary |
---|---|
Functions which reference to the file with the attribute id | |
file.writer.open [encoding] | file.out.open |
file.writer.close | file.out.close |
file.writer.print | file.out.print [encoding] |
file.writer.println | file.out.println [encoding] |
file.writer.println | file.out.println |
file.writer.print.sql | file.out.print.sql |
file.out.write | |
Functions to which the file is passed as entry argument. | |
file.chars.read [encoding] | file.bytes.read |
file.chars.write [encoding-src,encoding-dst] | file.bytes.write |
Nota informativa
It is discouraged the use of the functions file.out
, being preferable to use the funtions file.writer
.
File mode | ||||
---|---|---|---|---|
Type | Privilege | Name | Location | Description |
temp | base | application server $HOME/temp, a temporal file. It is the default option. | ||
absolute | final | application server filesystem, a file of absolute path. | ||
disktool | final | wic_conf:wic_user_diskdata, a entry to disktool. | ||
mailtool | final | wic_conf:wic_user_maildata, a entry to mailtool. |
Annex to the table 'File mode':
- privileged: For security the interpreter who executes the program XSQL-Script does not let any directory of the file system be accessed.
In the configuration database wic_conf the directories to which the XSQL-Script programs executed on a given server can access are determined.
- yes_ The server allows the acces to the enabled directories (parametrized for each of the servers WebStudio in the configuration database wic_conf).
- no: if the file is temporal is located in temporal directories of the file system.
- location: location of a file.
- final: The file is founded by the indicated name.
- base: if the file is temporal, the final name of the file has a randomly generated part and the indicated name forms the base of the final name.
- persistent: existence of the file.
- yes: The file is persistent, it will exist after the ending of the program.
- no: The existence of the file is limited to the execution time of the XSQL-Script. Once the program ends, it is removed.