From AlphaWiki

FAQ: HOME

(:title The $HOME variable)

In many of these wiki pages, path names are given relative to the $HOME variable. What does this mean? $HOME is just a folder on your local disk. A file path like

 
    $HOME/Tcl/Completions/TeXcmds.tcl

is simply a convenient way to describe a path name that is relative to the Alpha/Alphatk binary.

Topics in this page include:


Alpha8 and AlphaX $HOME Folders

The $HOME folder is the one containing the Alpha program (also referred to as the binary application) as in

(Your location will be different if you installed Alpha somewhere else on your disk.)


Alphatk $HOME Folders

In MacOSX, Alphatk is distributed as a bundled 'package' -- under normal circumstances, the Finder simply displays the name of the application. If you "Show Package Contents" (using any of the standard OS methods such as the Contextual Menu) you will find the contents of the AlphaTcl library buried in the hierarchy. In this case $HOME refers to one of these folders, as in

(Your location will be different if you installed Alphatk somewhere else on your disk.)

In all other platforms, $HOME refers to folder containing the Alphatk program.


Locating the $HOME Folder

Developers often include the string $HOME in their directions because there is an actual global variable named HOME that is used in various AlphaTcl procedures.

You can open an AlphaTcl Shell window (using Utils > Tcl Shell) and issue this command

 

    /Applications/Alpha

to identify the correct path. You can use this command:

 
     file::showInFinder $HOME

to locate $HOME on your local disk.


$HOME Contents

The $HOME folder contains all of the AlphaTcl files, plus the Help and Examples folders and anything else that is included in the standard distribution. Its contents might include

Tip: you can open an AlphaTcl Shell window (using Utils > Tcl Shell) and issue this command

 
     cd $HOME
    Alpha

to change the current directory used by the shell. Some unix-style commands are then available, such as

 
    Alpha ls
    AlphaPrefs {AlphaTcl Homepage.webloc} {AlphaX 8.0b17d3.app} AppleScripts Cache CVS Developer Examples Help {Icon
    } {Release Notes.txt} Tcl Tclextensions Tools {Update AlphaTcl}

Combined with the Tcl join command, you can get this:

 
    Alpha join [ls] \r
    AlphaPrefs
    AlphaTcl Homepage.webloc
    AlphaX 8.0b17d3.app
    AppleScripts
    Cache
    CVS
    Developer
    Examples
    Help
    Release Notes.txt
    Tcl
    Tclextensions
    Tools
    Update AlphaTcl
    Alpha

Advanced Topic: Also note that there is a related $ALPHA variable which refers to the current process.

 
    Alpha set ALPHA
    AlphaX_D

    Alphatk set ALPHA
    /Applications/Text Applications/Alphatk.app/Contents/MacOS/Alphatk

This variable is generally used for application interactions, when you need to identify the process that started some action or the one that should receive a result.


Category.FAQ

Retrieved from http://alphatcl.sourceforge.net/wiki/pmwiki.php/FAQ/HOME
Page last modified on January 23, 2006, at 03:18 PM