Uniface File I/O
Uniface provides facilities for reading, writing, and managing files, including configuration files, compressed files, XML files, and local user files and directories.
- Every time a Uniface application is started, the Uniface runtime engine first reads the configuration files, including assignment files and initialization files. It is possible to read and set selected settings in these files using the $setting ProcScript function. For more information see Configuration Files and $setting.
- Uniface uses XML files for data exchange, enabling you to export and import Repository definitions and user data. For more information, see Export and Import Facilities , Data Copy Facility, and XML Facilities.
- ProcScript commands such as filedump enable you to write files to the local file system. Other commands enable you to mange local files and directories. For more information, see Managing Files in Proc.
- Uniface can also read and write to ZIP files. For more information, see Zip Files.
Text File Encoding
When writing text files, Uniface uses the character set specified by $SYS_CHARSET assignment setting (if specified) or the operating system character set.
When reading and writing from zip files, it is possible to specify the character set to use using the $ZIP_CHARSET assignment setting.
Text files that are Unicode-encoded need to include a Byte-Order-Mark (BOM). For example, if you modify an assignment file to use a path containing a non-ANSI character, you need to change the encoding to
UTF-16) and ensure that the editor writes a BOM appropriate to the encoding. Most text editors provide a way of doing this, either via a menu option or when saving the file.
For XML files, the encoding can also be specified in the header.