File Assignments and Redirection

File assignments can be used to redirect non-DBMS files to other locations. Non-DBMS files can include Uniface UAR and XML files that Uniface controls, as well as HTML files and text files that may be used by the application. Uniface finds these files using locations listed in the [RESOURCES] assignment file section, and/or by file assignments in the [FILES] section.

Uniface expects its application files to be located in one or more UAR files specified in the [RESOURCES] section of the assignment file. All the locations listed in this section are available on the built-in $RES path.

The locations of other application files, such as XML, HTML, and text files, are specified in the [FILES] section.

A file assignment defines a logical file name and assigns it to a physical file name and location. It is possible to redirect files from one location to another using file assignments.

For example, in the following assignment, the logical file contacts.xml is assigned to the location c:\myApp\zip\contacts.xml

[FILES] 
contacts.xml = c:\myApp\contacts\contacts.xml

It is possible to redirect non-Uniface files listed in the [FILES] section to locations specified in the [RESOURCES] section using the $RES path. For example, the following assignment instructs Uniface to locate contacts.xml in a zip file whose location is specified by the [RESOURCES] section.

[FILES]
contacts.xml $RES:mydata.zip

[RESOURCES]
c:\MyApp\myapp.uar
c:\MyApp\mydata.zip

Note:  During development, it is possible to redirect non-Uniface files listed in the [FILES] section to locations specified by the $RESOURCES_OUTPUT setting. This setting specifies the location of compiled application sources or application resources required for testing and debugging.

Redirection

Be specific when file names include a path. For example, the input file d:\myXML\TheFile.xml substitutes to C:\workXMLd:\myXML\TheFile.xml if the assignment setting is only *.xml = c:\workXML\*.xml. To avoid this, use settings similar to the following:

[FILES]
*:*\*.xml = *:*\*.xml
*\*.xml = *\*.xml 
*.xml = C:\workXML\*.xml

You can also make use of USYS path logicals to specify file locations. For more information, see USYS Path Logicals.

Assignment file redirections accept ZIP archive definitions, where for example a file defined in the left part is redirected to a ZIP in the right definition of the assignment file. For example:

[FILES]
; All forms compiled into a ZIP archive
*.frm        =   myforms.zip:*.frm

; All xml files are imported from the sources ZIP in
; the installation directory

umeta.xml = usys:..\sources\sources.zip:umeta.xml

usysstat.xml = usys:..\sources\sources.zip:usysstat.xml utemplates.xml = usys:..\sources\sources.zip:utemplates.xml

Note:  ProcScript statements and functions for managing local files ignore file redirections in the assignment file. For more information, see ProcScript for File System Management.

Related Topics