Creating cross-platform directories in AFS
AFS associates a sysname with each type (operating system and version) of machine it is running on. For example, the sysname for a Facilitized Redhat FC5 host in the cs.cmu.edu AFS cell would be i386_fc5. The actual value of the sysname is cell specific. You can find out the system of a Unix host that you logged into by typing:fs sysnameA list of AFS sysnames for all supported platforms in the cs.cmu.edu cell can be found in the file /afs/cs/service/systypes.
When you access a file in AFS, if one of the components in the file's path is the string @sys, AFS will substitute the sysname in place of that component. For example, if you are on a Redhat FC5 host in the cs.cmu.edu AFS cell and run:
cat /afs/cs/user/bovik/@sysyou will list the contents of the file called:
/afs/cs/user/bovik/i386_fc5One can use this feature of AFS to create cross-platform directories for platform-specific files, such as executables and libraries. One common method of doing so is to:
- Create a directory called .bin in your AFS home directory.
- Within this .bin directory, create subdirectories named after each of the sysnames you care about. For example:
mkdir .bin/i386_fc5 mkdir .bin/sun4x_59
etc. - Then create a symbolic link from a directory called bin in your home directory to .bin/@sys by running a command such as:
ln -s .bin/@sys bin
The above example assumes you are in the directory where you originally created the .bin directory.

