TITLE
    MAE 2.0: Technical Note 1 of 3
Article ID:
Created:
Modified:
19227
1/17/96
10/8/97

TOPIC

    This article is the Macintosh Application Environment (MAE) 2.0 technical note.


DISCUSSION

    Table Of Contents
    -----------------
    The MAE Desktop and the Finder
    File System

    See Also
    --------
    MAE 2.0 FAQ (Frequently-Asked Questions), available on
    http://www.mae.apple.com or via anonymous ftp from ftp.support.apple.com
    in directory /pub/mae/info/FAQ/2.0.

    MAE 2.0 README.TXT (on MAE 2.0 product CD-ROM)


    The MAE Desktop and the Finder
    ==============================

    Support for MacsBug, Drag and Drop
    ----------------------------------
    Both MacsBug (a popular tool for debugging Macintosh applications) and Drag and Drop (a utility to assist Macintosh application launching) are not supported under MAE. Attempts to use either of these applications will have unpredictable results.

    Distributing Common Extensions, Control Panels, Preferences, etc.
    -----------------------------------------------------------------
    When MAE is started for the very first time for a particular user, it creates a System Folder in the user's $HOME directory by copying the files located in apple/sys directory. These system files can then be customized by the user to suit their particular MAE environment. If numerous users will be utilizing the same mail application, meeting planner or other productivity application, it is likely that one or more files will need to be added to their System Folder. By adding these files (typically Extensions and Control Panels) to the apple/sys directory (in their respective folders), a new System Folder can be created for each new user that already contains the necessary files. This way, only the application may need to be copied to the user's $HOME directory. In a similar fashion, you can distribute preset Preferences files as well. Note that this method of distributing common resources does not populate existing System Folders.


    For example, you might wish to place all the necessary Extensions and Control Panels in the apple/sys directory for a network-based mail application, and include the Preferences file for that application. This would ensure that the user already had the proper name and location of the mail server as well as any additional system resources required by the application.

    Using Global Fonts to Minimize Disk Usage
    -----------------------------------------
    By default, MAE users do not share their individual Fonts directories. Since each user must be able to modify the directory (for both adding and deleting fonts), management of the Fonts directory as a modifiable shared resource would be difficult. As an alternative, have the system administrator create a globally accessible Fonts directory which is read-only and allow only the superuser to add or delete fonts. In this manner, the directory can be populated with many fonts that would otherwise be duplicated for each user, thus preserving more disk space. Once this has been done, each user can delete their private Fonts directory and create a symbolic link to the shared Fonts directory (using `ln -s').


    Icon Placement When Resizing Windows
    ------------------------------------
    Whenever the display window for the MAE desktop is resized, all icons are aligned on the right side of the window. The Trash will be moved to the lower right corner and the startup drive (which always appears as "/" in MAE) will appear on top. Any other icons, including the user's home directory, are placed below and to the left of the startup drive. To avoid the loss of any custom icon placement you can iconify MAE if more workstation desktop space is desired.

    Flashing Menu Bar After Exporting to X
    --------------------------------------
    If text is selected from an open application such as "Note Pad" and exported to X (using the "Export to X" key from the MAE toolbar), the Finder menu bar may flash or disappear when returning focus to MAE. If this happens, clicking on the Macintosh Desktop within MAE will restore the menu bar.

    Rebuilding the Desktop
    ----------------------
    If MAE is started with the -rebuild option, MAE will search for files in the System Folder and appledir. If you have applications and documents that are not in these directories, they will revert to generic icons until they are used again by the Finder. This is different from native Macintosh behavior and was implemented to prevent MAE from potentially trying to resolve icons for multiple remotely-mounted file systems, which could take a great deal of time. However, you can put symbolic links into a directory of your choosing and have those file systems searched during a Desktop rebuild. To do this, start MAE with the -applepath <dir> option, where <dir> is the full pathname of the directory. For example, if your symbolic links are located in a directory whose path is /usr/joe/rebuild, you can start MAE with


    mae -rebuild -applepath /usr/joe/rebuild

    Files that are contained within folders that have been assigned a label from the Finder (for example, "Hot") will revert to an unlabeled state when the Desktop is rebuilt. This behavior does not occur with files that are located on the Desktop itself.

    Creating Aliases by Dragging Files to the MAE Desktop
    -----------------------------------------------------
    When you drag an item to the MAE desktop, MAE creates a Macintosh alias to the item; the item itself remains in its original location. The name of the alias is the name of the original item plus the word "alias"; it is displayed in italics. For example, if you drag a file called "My.file" to the desktop, MAE creates an alias called "My.file alias." You can open the original item by double-clicking its alias on the desktop. If you delete the alias by dragging its icon to the Trash, the original item is not deleted. (For more information about aliases, see "Creating an Alias" in the MAE USER'S GUIDE, Appendix A.)

    Aliases themselves are treated no differently from other items; dragging an alias to the desktop creates an alias to the alias to appear on the desktop. For example, if you drag an alias called "Status.report alias" to the desktop, MAE creates an alias called "Status.report alias alias."

    Because this treatment of aliases differs from standard Macintosh procedure, it can confuse experienced Mac users. For example, in a Macintosh, to bring an alias of an item to the desktop, you select the item, make an alias using the MAKE ALIAS entry in the finder's FILE menu, then drag the alias to the desktop. The same sequence of events in MAE causes a second-level alias to appear on the desktop, and leaves the first-level alias in the same folder as the original item. The alias on the desktop appears to function normally, but it actually refers to the first-level alias, not to the original item. If you delete the first-level alias ("Status.report alias"), you will no longer be able to use the second level alias on the desktop ("Status.report alias alias") to refer to the original item.


    Aliases and Multiple UNIX File Systems
    --------------------------------------
    If an item that is the target of an alias is moved to a different file system, the linkage between the alias and the original item is broken; double-clicking the alias will no longer open the original item. MAE displays an alert box, telling you that it cannot locate the original item. For example, if you create an alias to a file located in /usr, and then drag the file to your home directory, MAE won't be able to open the file when you double-click its alias. Similarly, if you select the alias, choose Get Info from the File menu, and click the Find Original button, MAE displays an alert box, telling you that the command could not be completed because the original item could not be found.

    If the Message "~ not found" Appears When You Launch a UNIX Command
    -------------------------------------------------------------------
    MAE allows you to add options and arguments to a UNIX command when you launch the command from the MAE desktop. When you hold down the Control key while you double-click a UNIX file, the command-launch dialog box appears. You can add options and arguments to the command by typing them in the command-launch dialog box. (See "Adding Command Options when Opening a UNIX Command File" in the MAE USER'S GUIDE.) However, some special symbols commonly used in UNIX commands are not treated by MAE in the same way they are in UNIX, and should not be included in the command-launch dialog box. These include the tilde (~) character and environment variables such as $HOME.


    Changing the Font Size on the Desktop
    -------------------------------------
    Use the Views Control panel to select the size of the desktop font used for filenames.

    Find File
    ---------
    The Finder's Find File utility may find the same file more than once if it traverses symbolic links. Because it reports the actual path, rather than the symbolic path, you may see items repeated with the same pathname.

    Remote mountpoints will be searched by the Finder's Find File utility, even though the option in that utility says "Find items on Local Disks". MAE treats all UNIX mount points as local. The "mounted servers" option refers to AppleShare servers mounted via the Chooser.


    File System
    ===========

    Application Location for Optimal Performance
    --------------------------------------------
    To obtain the best possible performance from your Macintosh applications with MAE, you can place all applications in one central directory on a local disk. By doing this, you will decrease the time it takes to load the application into memory, as applications located from remote volumes will be subject to network performance. Even if you are not able to store the applications locally, placing them in a single directory will enable MAE to better associate documents with their creator applications. This is performed the very first time MAE is launched, and is referred to as `rebuilding the desktop.' For more information on this strategy (and usage of the `-applepath' command line switch), please refer to Tech Note #2, available via FTP or via WWW.


    File Type of UNIX Files
    -----------------------
    An MAE Get Info operation on a UNIX file, either a text file or a binary file, shows the type of file as "MAE Helper Document". This is normal MAE behavior, to support UNIX file launching.

    How does MAE handle case-sensitive MAE file names?
    --------------------------------------------------
    MAE has two modes of treatment for file names:

    Case-insensitive (the default mode).

    Case-sensitive, selected by the -caseon option on the MAE command line.

    In the default (Case-insensitive) mode, MAE behaves like a Macintosh. The file name "a" is treated the same as the file name "A". If you have a file named "a" and try to save a new file named "A", MAE will ask you to confirm that you want to replace the file, as in Mac OS. If two UNIX files "a" and "A", are in the same directory, MAE will see only one of them.

    When MAE is executed with the -caseon option, file name treatment is case-sensitive. The files "a" and "A" are treated differently. You can have both a file named "a" a new file named "A" in the same directory. Both files will show up in the Standard File dialogs.


    Because the determination of case sensitivity is happening at the lowest level of the file system, the Finder and all applications share the file view described above.

    Installation onto AFS filesystems (HP)
    --------------------------------------
    On HP-UX systems, MAE installation may fail with the error message "Read-only filesystem". Also, a bug in the MAE installer is sensitive to extremely large AFS file systems.

    A simple workaround to circumvent these difficulties: install MAE on a local or NFS volume, then copy the entire result - the apple directory, and the System Folder and .mac folders, if they exist - to AFS.

    AppleSingle and AppleDouble File Formats
    ----------------------------------------
    By default, MAE stores files in the UNIX file system in a format called "AppleSingle", which is unlike Mac OS files, which have both resource and data forks. In AppleSingle-format files the resource fork information is prepended to the data fork, creating one file -- a larger file that you see in UNIX.

    This explains why using MAE to copy files from a CD or from network-based volumes can result in source and destination files of different sizes, as viewed by the UNIX file system.


    If this behavior is unacceptable, you can force MAE to default to saving files as AppleDouble by adding the -filedouble option to the MAE command line. This forces MAE to keep Mac OS files as separate data and resource forks. From MAE, it will appear as one file, but within UNIX, you will see a file name 'name' (data fork) and '%name' (resource fork). The file 'name' will then be the same size in UNIX as the Finder reports.

    Also, UNIX applications may fail to recognize MAE AppleSingle files, because they see them as corrupted. This "corruption" can occur in a number of different ways. For example, under FileShare, if a UNIX file is dragged from a Macintosh to MAE, the file will be written by MAE in AppleSingle format, which may make it unusable. This occurs because the Macintosh doesn't know anything about UNIX files, so when it sends one to MAE, MAE thinks it's a Macintosh file and writes it to disk accordingly.

    This situation does not occur between two MAE sessions that are sharing files, since MAE recognizes UNIX files for what they are and does not store "resource" information about them. When dragging a UNIX file between two MAE sessions, MAE correctly treats the file as a UNIX file.


    Using ftp utilities such as Fetch from MAE can also be problematic. When "getting" a file, Fetch will pass the file to MAE to be written to disk. This works fine for Macintosh files since they will be written as AppleSingle files. However, when "getting" a UNIX file, MAE will likewise write this file as an AppleSingle file, which can make it unusable by UNIX applications.

    Text files are handled differently by MAE. Text files are always written by MAE in AppleDouble format to facilitate reading and writing by both Macintosh and UNIX applications (newline characters are automatically translated by MAE; they are stored on disk as UNIX newlines). So in the examples above, when dragging a text file from a Macintosh to MAE or when Fetch gets a file using ftp "Text" mode (that is, ASCII mode), MAE will write the file in AppleDouble format.

    NOTE: Fetch 3.0 and higher will not work with MAE 2.0.2, use version 2.x.x.

    As a rule of thumb, it's best to use UNIX to work with UNIX files and MAE to work with Macintosh files. If your environment requires the same (non-text) files to be regularly handled by both MAE and UNIX, then you're probably a candidate for running MAE in AppleDouble mode, by launching it with the -filedouble option.


    If this behavior is unacceptable, you can force MAE to default to saving files as AppleDouble by adding the -filedouble option to the MAE command line. This forces MAE to keep Mac OS files as separate data and resource forks. From MAE, it will appear as one file, but within UNIX, you will see a file name 'name' (data fork) and '%name' (resource fork). The file 'name' will then be the same size in UNIX as the Finder reports.

    Space for /users (HP)
    ---------------------
    On HP Series 700 workstations the capacity of /users may need to be increased to provide space for an MAE System Folder for each user. When this necessitates the creation of a new file system, the new file system must support long file names.

    The process below copies the contents of /users to a new MAE-compatible file system:

    Log on as superuser

    If /users is a MOUNTED FILE SYSTEM, create a new mount point /users.temp
    and remount /users on /users.temp. If /users is IN THE ROOT FILE SYSTEM,
    change the name of /users to /users.temp by using the command


    mv /users/users.temp

    To create a new file system, start SAM (System Administration Manager)
    by typing the command

    sam &

    Use SAM to perform these steps:

    1) Select "Disks & File Systems" -> "CD-ROM, Floppy and Hard Disks"
    2) Select the new SCSI Drive, highlight 'Action' and select 'Add a Hard
    Disk'
    3) Select 'Modify Defaults' and select "Use Long File Names" (See NOTE)
    4) Select OK and mount the new File system to /users
    5) exit SAM

    NOTE: The "Use Long File Names" option results in a file system that
    will support file names longer than 14 characters. The SAM default
    supports file names only up to 14 characters, and prevents MAE from
    properly creating long Macintosh file names on that file system.

    Now copy the contents of /users.temp to the new file system as follows:

    cd /users.temp
    find . -print -depth | cpio -pdumv /users

    Before proceeding, verify that the contents of /users are the same as
    the contents of /users.temp.

    If /users.temp is a MOUNTED FILE SYSTEM, unmount it. If /users.temp is

    IN THE ROOT FILE SYSTEM, remove it with the command

    rm -rf /users.temp

Document Information
Product Area: Communications-Networking
Category: MAE (Macintosh Application Environment)
Sub Category: General Topics

Copyright © 2000 Apple Computer, Inc. All rights reserved.