TOC PREV NEXT INDEX

 


Determining Path References in Wrapped Applications


As discussed in "How the Internal File Archive Works in a Wrapped Application", you must use relative pathnames to access files stored in the internal archive of a wrapped application. The proper pathname to use to access a file from the archive depends on your prowrap command arguments.

By default, files that you specify in your prowrap command with relative pathnames retain that pathname in the archive. Files that you specify with absolute pathnames are stripped of their drive and root directory characters. For example, consider in the following:


C:> prowrap myApp.tcl D:\tcl\common\utils.tcl

To source D:\tcl\common\utils.tcl from within your wrapped application, you would need to use a command such as:


source [file join tcl common utils.tcl]

You can also change the resulting pathname for a wrapped file with the relativeto directory option to prowrap. The relativeto flag instructs TclPro Wrapper to wrap all file name patterns that follow relative to the directory you specify. As an example, consider the following:


C:> prowrap myApp.tcl -relativeto D:\tcl\common \
    D:\tcl\common\utils.tcl

In this case, the resulting pathname for D:\tcl\common\utils.tcl from within your wrapped application is simply utils.tcl.

Table 11 summarizes how wrapped file pathnames are determined.

Table 11 Resolving File Pathnames When Wrapping an Application
Path Type
Using relativeto flag?
Resulting Wrapped File Pathname
Example
Relative
No
The given relative pathname (including any "." or ".." relative pathname references)
images/icon.gif and ../lib/control.tcl remain the same
Relative
Yes
The pathname of the file relative to the relativeto directory
images/icon.gif with relativeto images becomes icon.gif
../lib/control.tcl with relativeto ../lib becomes control.tcl
Absolute
No
The full pathname of the file without the root directory
/usr/local/tcl/lib/common.tcl becomes usr/local/tcl/lib/common.tcl
Absolute
Yes
The pathname of the file relative to the relativeto directory
/usr/local/tcl/lib/common.tcl with relativeto /usr/local/tcl becomes lib/common.tcl




http://www.ajubasolutions.com
Voice: (650) 210-0100
Fax: (650) 210-0101
support@ajubasolutions.com
TOC PREV NEXT INDEX