Computing Facilities    links to the SCS and CMU home pages Carnegie Mellon School of Computer Science Carnegie Mellon University
 
Advanced search tips 
 
 » Introduction to Facilities 
 » Accounts & passwords 
 » AFS 
 » Application software 
 » AV help 
 » Backups & restores 
 » Calendaring 
 » E-mail 
 » Networking 
 » Printing 
 » Purchasing 
 » Resource management 
 » Security 
 » Software licensing 
 » Support charges 
 » Web publishing 
 » Mac support 
 » Linux support 
 » Windows PC support 

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 sysname
A 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/@sys
you will list the contents of the file called:
   /afs/cs/user/bovik/i386_fc5
One 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:
  1. Create a directory called .bin in your AFS home directory.
  2. 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.
  3. 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.
The same general method can be used to create platform-specific lib and other directories.