Qorus Integration Engine
3.1.0.p16
|
provides access to the filesystem More...
Functions | |
nothing | fs.init () |
initalizes the system fs service | |
nothing | fs.rename (string source, string target, softbool man=False) |
rename/move a file More... | |
nothing | fs.rename_conn (string conn_src, string source, string conn_tgt, string target, softbool man=False) |
rename/move a file More... | |
nothing | fs.copy (string source, string target) |
copy a file More... | |
nothing | fs.copy_conn (string conn_src, string source, string conn_tgt, string target) |
copy a file More... | |
nothing | fs.del (string path) |
delete a file More... | |
nothing | fs.del_conn (string conn, string path) |
delete a file More... | |
list | fs.ls (string path, *string regex, *softint reopts, *string encoding) |
lists files in the given directory More... | |
list | fs.ls_conn (string conn, *string path, *string regex, *softint reopts, *string encoding) |
lists files in the given directory More... | |
binary | fs.get_file_bin (string path) |
returns the given file as binary data More... | |
binary | fs.get_file_bin_conn (string conn, string path) |
returns the given file as binary data More... | |
string | fs.get_file_string (string path, *string encoding) |
returns the given file as string data More... | |
string | fs.get_file_string_conn (string conn, string path, *string encoding) |
returns the given file as string data More... | |
nothing | fs.write_file (string path, data data, int mode=0664, *string encoding) |
writes the input data to the given location More... | |
nothing | fs.write_file_conn (string conn, string path, data data, int mode=0664, *string encoding) |
writes the input data to the given location More... | |
*hash | fs.hstat_file (string path) |
runs Qore::hstat() on a file target and returns the result More... | |
*hash | fs.hstat_file_conn (string conn, string path) |
runs Qore::hstat() on a file target and returns the result More... | |
provides access to the filesystem
The streams in the following table are provided.
Supported Data Streams
Stream | Dir | HTTP Method | Args | Description |
get-file | out | GET | path=string rename=string del=boolean timeout=ms [block=integer] | Reads a file and streams the raw data as binary data to the sender, where it can be converted to a string and encoded with a particular encoding if necessary. Requires FILESYSTEM-CONTROL or FILESYSTEM-READ permissions to access |
get-xml-data | out | GET | path=string rename=string del=boolean element=string timeout=ms [encoding=string] [block=integer] | Reads an XML file and streams records to the sender. Requires FILESYSTEM-CONTROL or FILESYSTEM-READ permissions to access |
get-csv-data | out | GET | path=string rename=string del=boolean timeout=ms [block=integer] csvutil=hash see CsvUtil::CsvFileIterator::constructor() for details the structure of this hash] | Reads a CSV or other structured data file parsable with CsvUtil::CsvFileIterator and streams records to the sender. Requires FILESYSTEM-CONTROL or FILESYSTEM-READ permissions to access |
get-fixed-data | out | GET | path=string rename=string del=boolean timeout=ms [block=integer] fixedlengthutil=hash with "spec" and "opts" keys; see FixedLengthUtil::FixedLengthFileIterator::constructor() for details on the meanings of the values of these hash keys] | Reads a fixed-length file parsable with FixedLengthUtil::FixedLengthFileIterator and streams records to the sender. Requires FILESYSTEM-CONTROL or FILESYSTEM-READ permissions to access |
put-file | in | POST | path=string timeout=ms [target_path=string] [mode=int] [encoding=string] | Accepts streamed string or binary data and writes the data to the given file |
copy a file
source | the source path |
target | the target path |
If any errors occur, an exception is thrown
COPY-ERROR | cannot stat() source file |
copy a file
conn_src | the source user connection name |
source | the source path, relative to conn_src |
conn_tgt | the target user connection name |
target | the target path, relative to conn_tgt |
If any errors occur, an exception is thrown
CONNECTION-ERROR | the given connection is not known |
COPY-ERROR | cannot stat() source file |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
nothing fs.del | ( | string | path | ) |
delete a file
path | the path of the file to delete |
If any errors occur, an exception is thrown
UNLINK-ERROR | error removing the file |
delete a file
conn | an user connection name |
path | the path of the file to delete, relative to conn |
If any errors occur, an exception is thrown
CONNECTION-ERROR | the given connection is not known |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
UNLINK-ERROR | error removing the file |
returns the given file as binary data
path | the path of the file to retrieve |
returns the given file as binary data
conn | an user connection name |
path | the path of the file to retrieve, relative to conn |
CONNECTION-ERROR | the given connection is not known |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
returns the given file as string data
path | the path of the file to retrieve |
encoding | the encoding of the source file |
returns the given file as string data
conn | anuser connection |
path | the path of the file to retrieve |
encoding | the encoding of the source file |
CONNECTION-ERROR | the given connection is not known |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
runs Qore::hstat() on a file target and returns the result
path | the path of the file to stat |
runs Qore::hstat() on a file target and returns the result
conn | a user connection; must be a filesystem connection |
path | the path of the file to stat |
CONNECTION-ERROR | the given connection is not known |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
lists files in the given directory
path | the path to list |
regex | an optional regex to filter the results |
reopts | option regular expression options; see Regular Expression Constants for possible values |
encoding | the encoding of the filesystem string data |
"name"
key with the file or directory name and optionally a "link"
key for symbolic link targetsDIR-ERROR | directory does not exist |
lists files in the given directory
conn | an user connection name |
path | the path to list, relative to conn. It can be empty, then the toplevel connection directory is listed. |
regex | an optional regex to filter the results |
reopts | option regular expression options; see Regular Expression Constants for possible values |
encoding | the encoding of the filesystem string data |
"name"
key with the file or directory name and optionally a "link"
key for symbolic link targetsCONNECTION-ERROR | the given connection is not known |
DIR-ERROR | directory does not exist |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
rename/move a file
source | the source path |
target | the target path |
man | rename the file manually by copying the file's data and then deleting the source file, this is sometimes necessary on some OSes when renaming files across filesystem boundaries |
If any errors occur, an exception is thrown
RENAME-ERROR | cannot stat() source file |
nothing fs.rename_conn | ( | string | conn_src, |
string | source, | ||
string | conn_tgt, | ||
string | target, | ||
softbool | man = False |
||
) |
rename/move a file
conn_src | the source user connection name |
source | the source path, relative to conn_src |
conn_tgt | the target user connection name |
target | the target path, relative to conn_tgt |
man | rename the file manually by copying the file's data and then deleting the source file, this is sometimes necessary on some OSes when renaming files across filesystem boundaries |
If any errors occur, an exception is thrown
CONNECTION-ERROR | the given connection is not known |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |
RENAME-ERROR | cannot stat() source file |
writes the input data to the given location
path | the path of the file to write |
data | the file data to write |
mode | the file's creation mode |
encoding | the encoding of the target file |
nothing fs.write_file_conn | ( | string | conn, |
string | path, | ||
data | data, | ||
int | mode = 0664 , |
||
*string | encoding | ||
) |
writes the input data to the given location
conn | a user connection |
path | the path of the file to write, relative to conn |
data | the file data to write |
mode | the file's creation mode |
encoding | the encoding of the target file |
CONNECTION-ERROR | the given connection is not known |
FS-USER-CONNECTION-ERROR | the given connection is not a filesystem connection |