With the File System add-on, it is possible to read and write files (even incrementally), and to read and create directories.
Find below a table listing some common tasks you can use the File System Adapter for, and which action to use for which task.
Task | Action | Mode | Important Parameters | Comments |
---|---|---|---|---|
Write a complete file in one action. | write |
| ||
Replace part of a file. | write | position | Writes the data to the file beginning at the specified position. If the file does not exists you'll get the exception FSADM/8 (see Catching Errors). | |
Append data to a file. | append | append |
| |
Write a complete file line by line. | append | overwrite | Use mode overwrite for all appends.
overwrite will only be applied to the first append. All subsequent appends (e.g. in a loop) automatically get mode append. | |
Copy a complete file. | copy Runtime 2020.4 Builder 7.8.0 | Copy a file in one action. Using copy you can even copy huge files because it does not load the complete file into memory. | ||
Manipulate a file and process the file further (e.g. moving it). | Before processing the file further (e.g. moving it), close the file. Otherwise it may be locked. |
We distinct between static and dynamic requests.
All errors thrown by the File System adapter can be caught as described in Catching Errors.