Jim Luther

page revised 10/24/2002

If an Apple link doesn't work for you, you can go to Apple's Developer web page and use "Search" to find where most of my broken links should go.

What's New!


What can I find on Jim's page?


What I do and what I've done

I'm currently employed at Apple Computer, Inc. in Cupertino, CA where I work in the Mac OS X File Systems group. After years of making things work better and faster in Mac OS 7, 8 and 9, I now get to help improve a whole new operating system (at least it's new to me). My current target is the WebDAV file system -- the file system that is used to mount iDisk. WebDAV has been my assignment since just before Mac OS X version 10.1.1. The latest released version of the WebDAV file system is in 10.2.

Before that, I worked in the Mac OS Releases group for over 6 years on the Mac OS 7, 8 and 9 File Manager, Disk Cache, File System Manager, Virtual Memory, Memory Manager, Start Manager, etc. (parts of Mac OS you don't see, but that you want to work correctly). I also contributed bits and pieces of code to MacsBug, the best low-level debugger for Mac OS 9 and earlier systems.

I worked for briefly at General Magic as a Developer Technical Support Engineer. There, I provided support to developers of products for Personal Intelligent Communicators that used General Magic's Magic Cap operating system. General Magic spun off its Mobile Computing Division as a company named DataRover Mobile Systems, Inc. which later changed its name to Icras, Inc., which is now no longer in business. I guess I made a wise decision going back to Apple.

Before General Magic, I worked for Apple Computer, Inc. where I was a Developer Technical Support Engineer in the Apple II Developer Technical Support group (1989-1990) and then in Macintosh Developer Technical Support (1990-1995). As a Mac DTS engineer, I supported various parts of the Macintosh operating system - in particular, I learned a lot about classic AppleTalk, the Program-to-Program Communications (PPC) Toolbox, AppleShare, the Deferred Task Manager, the Alias Manager, disk drivers, the File System Manager, the Desktop Manager, the Finder, and the File Manager.

Before Apple, I worked mostly as a Repair Technician / Field Engineer / Customer Engineer. Those are all names for jobs where I fixed various kinds of electronic equipment including aviation navigational equipment, biomedical electronics, medical imaging equipment, main-frame computers, mini-computers, data terminals, printers, etc. At my last technician job, I worked at Johnson County Community College in Overland Park, KS. There, I was given a few chances to design and write software in my spare time and found I liked programming personal computers more than I did fixing them. During the same time that I worked during the day at J.C.C.C., I also worked as the first Forum Leader of the Apple II Developers Forum on AppleLink, Personal Edition (now America Online). That part-time job put me in contact with Apple and next thing I knew, I was in California working for Apple.


Macintosh sample code I've written

One of the things I learned during my years in Apple's Developer Technical Support group is that the best way to answer a programming question is with source code that shows a solution. Writing code to answer a question isn't always possible because of time constraints, but when there's time, writing code ensures that the answer is most likely correct and leaves you with code you can reuse to help answer future questions. It also has a great side benefit -- you really learn how that part of the system works.

Here's a list of sample code I've written or worked on that you can get to from here (most of this is rather dated except for MoreFiles/MoreFilesX):

MoreFilesX

MoreFilesX is a collection of useful high-level File Manager routines that use the HFS Plus APIs introduced in Mac OS 9.0 wherever possible.

While many of the routines in MoreFilesX are based on the older MoreFiles sample code (which used the older File Manager APIs), by using the HFS Plus APIs, the routines in MoreFilesX have several advantages over the older MoreFiles code:

If you are writing new Carbon applications for Mac OS X that call the File Manager, you should use MoreFilesX -- not MoreFiles. If you're porting existing applications to Mac OS X and those applications use routines from MoreFiles, you should consider switching to the routines in MoreFilesX.

The routines were designed for applications running in the Mac OS X Carbon environment. All of the routines will work under Mac OS 9 if you define BuildingMoreFilesXForMacOS9 to 1. Doing that removes code that calls Mac OS X only APIs. MoreFilesX cannot be used in pre-Mac OS 9 system releases.

The routines in MoreFilesX have been tested (but not stress-tested) and are fully documented.

You can download the latest release of MoreFilesX (version 1.0.1) from my directory on mac.com. Bug reports and enhancement requests for MoreFilesX can be filed at Apple's Bug Reporting web page (tell me about them directly and your report/request will likely be lost).

MoreFiles

I answered lots of File Manager questions with code snippets and so I ended up with lots of code snippets showing how to do various things with the File Manager. In 1992, I started collecting, sorting, and polishing those code snippets into a sample code library called MoreFiles. MoreFiles is written in C, but can be used from either C or Pascal.

If you are writing new Carbon applications for Mac OS X that call the File Manager, you should use MoreFilesX -- not MoreFiles. If you're porting existing applications to Mac OS X and those applications use routines from MoreFiles, you should consider switching to the routines in MoreFilesX. For new development, MoreFiles should only be used if your program simply must run on pre-Mac OS 9 system software.

MoreFiles is now in maintance mode -- no future releases are planned unless serious bugs are found in the code.

You can download the latest release of MoreFiles (version 1.5.4) from my directory on mac.com. Bug reports for MoreFiles can be filed at Apple's Bug Reporting web page (tell me about them directly and your report/request will likely be lost).

RAMDisk

Gordon Sheridan wrote a RAM disk sample for Apple DTS but it was never released during his tenure there. I cleaned up and commented Gordon's source code, added lots of new functionality to it, and killed most of the bugs in it, but it still was never released. Brian Bechtel made the source for RAMDisk compile with all C compilers for the Macintosh, and killed a few more bugs. Quinn (who works in Apple DTS) did a major cleanup of the code last year. You can download the latest version of RAMDisk with its C source code from Apple's web server.

VBL Snippet

I wrote this simple example of a persistent VBL written in C that can be compiled as either 68K code or PowerPC code. You can download the C source code to VBL Snippet from my directory on mac.com.

SwitchStack

I wrote this simple example to show how to run 68K interrupt-time code on a private stack. Note that this technique only works with 68K code (not PowerPC code) and interrupt-time code such as VBL tasks, Deferred Task Manager tasks, completion routines, etc. You can download the C source code to SwitchStack (which works with MPW C, THINK C and Metrowerks C) from my directory on mac.com.

UnmountIt

I wrote UnmountIt as a temporary work around for a Macintosh File Sharing limitation. The limitation was this: you couldn't unmount a volume File Sharing considered sharable when File Sharing was on. That limitation was removed with File Sharing version 7.6.1 which is part of Apple's System 7.5 Update 1.0 (Macintosh System 7.5.1). However, UnmountIt is still useful for users of System 7.0 through 7.5.

The source code for UnmountIt version 1.2 shows a simple drag & drop application, how to use some AppleShare Server Control calls, and how to unmount (and possibly eject) a disk volume. You can download the Pascal source code for UnmountIt 1.2 from Apple's ftp server.

Server Remote Control

While writing the draft of the AppleShare 3.0 documentation, I found that I needed to access my system at work from home over an AppleTalk Remote Access connection. Unfortunately, I'd sometimes forget to turn on File Sharing on my work system and so after connecting to the work network, I'd not be able to access my work system. So, I wrote Server Remote Control.

Server Remote Control consists of two applications, a server application and a client application, which communicate over an authenticated PPC Toolbox connection. The server application (Server Controller) is a faceless background-only application which tells the client application (Remote Control) the current state of the Macintosh File Sharing, or AppleShare server running on the server Macintosh. Server Controller also accepts requests from Remote Control to start or stop the file server. Remote Control allows the user to find a system running Server Controller, authenticate the connection (only the server's owner may control the server), and then provides a simple user interface to let the user control the file server.

You can download the Pascal source code for Server Remote Control version 1.1 which shows how to communicate between two applications using an authenticated PPC Toolbox connection and how to use some AppleShare Server Control calls from Apple's ftp server.

One final note... While Server Remote Control is still useful as a programming example, its original purpose (turning on/off File Sharing on a remote system) isn't really needed now. AppleScript, along with the scriptable Finder, lets you turn on or off File Sharing on any remote system you have Program Linking access to using these two simple AppleScripts:

-- turn File Sharing ON
tell application "Finder" of machine "Remote Macintosh" of zone "Zone name"
set File Sharing to true
end tell

-- turn File Sharing OFF
tell application "Finder" of machine "Remote Macintosh" of zone "Zone name"
set File Sharing to false
end tell

For another example of PPC Toolbox programming, see PPC Toolbox Sample.

Network Watch (DMZ)

I can't claim much of the credit for Network Watch. Pete Helme wrote the original DMZ program and Rich Kubota has maintained and enhanced it for the last few years. However, Rich dropped the Datagram Delivery Protocol (DDP) socket listener sample I wrote into Network Watch, so I guess I can claim a little of the credit. (Among other things, my socket listener and some other code I wrote is used in the LaserWriter Font Utility program by the code that lets you find the local zones an Etherneted LaserWriter is in.)

Network Watch shows a couple of fundamental AppleTalk techniques: how to get a list of AppleTalk zone names and how to get a list of AppleTalk Name Binding Protocol (NBP) names from a particular zone. Additionally, Network Watch lets you send an Echo Protocol packet to any AppleTalk entity and measures the round-trip time for that packet (this is where my socket listener code was used).

You can download the latest version of Network Watch from Apple's ftp server.

N & C MacsBug Macros/Templates

My debugger of choice is MacsBug (it is also what most of my co-workers use). MacsBug can be extended by writing dcmds (code resources that let you add MacsBug commands), by creating macros, or by creating memory templates. Macros allow you to substitute one string for another. Templates allow you to view memory as something other than raw hexadecimal/ASCII data. Macros and memory templates are the easiest to create because all you need is a resource editor like ResEdit.

While supporting classic AppleTalk and the PPC Toolbox, I wrote a set of macros and memory templates that let you break on any AppleTalk or PPC Toolbox call, and dump any AppleTalk or PPC Toolbox data structure. You can download my N & C MacsBug Macros/Templates collection from Apple's ftp server and add them to your MacsBug preferences.

Faceless Background-only Application

Again, I can only assume partial credit. C.K. Haun wrote a column for develop magazine issue #9 titled "Background-Only Applications in System 7." The article came with a simple example Faceless Background-only application. The code needed to be updated for several reasons and that's what I contributed. You can download the sample Faceless Background-only application from Apple's ftp server.

ExitToShellPatch

Some calls your program makes must be balanced by another call before your program quits. For example, if your program opens a PPC Toolbox port, your program is responsible for closing that port, or if your program registers an NBP name, your program is responsible for removing that name. If your program doesn't clean up after itself, it can result in a system crash later. So, what do you do if your program terminates unexpectedly (for whatever reason)? You patch ExitToShell and let your ExitToShell patch perform the clean up work if needed.

ExitToShellPatch is a very simple program based on an ExitToShell patch Dave West wrote. The program registers an NBP name, but (on purpose) doesn't remove that name before quitting. However, the program also patches ExitToShell and the patch removes the name. You can download ExitToShellPatch from my directory on mac.com.

Inside Macintosh: Networking, NBP and ZIP snippets

Most of the snippet code in Inside Macintosh volumes is written in Pascal when most developers are programming in C. Funny huh? Anyway, since I wrote the snippet code for the NBP and ZIP chapters of Inside Macintosh: Networking so that they could be dropped into your programs as tested, working functions, I figured they'd be more useful in C, so I ported them.

You can download the Inside Macintosh: NBP and ZIP snippets in C from my directory on mac.com.

PPC Toolbox Sample

This sample is the simplest example of Program-to-Program Communications (PPC) Toolbox client and server applications that I know of. Both applications show how to use asynchronous PPC Toolbox requests from an application. The server application supports multiple sessions to its single PPC Port and shows how to use an OS queue to pass requests that cannot be processed at interrupt time back to the application's event loop. The client application shows how to open a session, send requests to the server, and close the session.

You can download the PPC Toolbox sample from my directory on mac.com. For another example of PPC Toolbox programming, see Server Remote Control.

PPC GestaltValue

Apple's Dave Radcliffe wrote a nice little 68K library, GestaltValue, that let you easily create, use, and delete a Gestalt selector that returns a response value. The routines in the GestaltValue library were added to the Macintosh OS with System 7.5. However, that didn't solve the problem for PowerPC applications which need to work with System 7.1.2 (the first PowerPC Mac OS).

I put GestaltValue into a stand-alone 68K code resource and wrote a little glue code to load the code resource and call it. You can download my PPC GestaltValue glue code and add it to GestaltValue for a solution that works in both 68K and PowerPC applications.

Code I didn't write (but you may find useful)

Joe Zobkiw wrote a book with the really long title of "A fragment of your imagination: code fragments and code resources for Power Macintosh and Macintosh programmers" (ISBM 0-201-48358-0). Addison-Wesley Publishing Company asked me to be one of the technical reviewers for the book. I recommend this book if you need to write stand-alone code resources or code fragments for the Macintosh.

The book comes with a CD-ROM containing Metrowerks CodeWarrior Lite and the book's source code.


Documentation I've written

With computers, the most important tool a developer can have is good documentation. While in Apple Developer Technical Support group, I was "given the chance" to write a lot of documentation. Here's a list of the documentation I wrote some or all of that you can find online:

Asynchronous Routines on the Macintosh

I wrote the lead article in develop magazine issue #13, Asynchronous Routines on the Macintosh to try to put everything I'd learned about calling functions asynchronously in one place.

I started with the material I collected for the session Scott Boyd, Gordon Sheridan, and I presented at Apple's 1992 Worldwide Developer's Conference, and added information gleaned from the AppleShare team, the AppleTalk team, and the PPC Toolbox team. Then I worked with the editors and artists at develop for several months to polish the article.

If you ever need to write code that runs at interrupt-time and calls a device driver, the File Manager, AppleTalk, or the PPC Toolbox you should read this article.

You can download Asynchronous Routines on the Macintosh from Apple's ftp server.

File System Manager SDK

The short story of the File System Manager and how it shipped...

The File System Manager (FSM) is an obscure part of the Macintosh operating system that almost didn't exist. It was a proposed part of System 7.0 and at Apple's 1989 Worldwide Developers Conference (WWDC), developers were given a "sanitized" engineering specification that described some of FSM's core routines. System 7.0 and later System 7.1 shipped and FSM still wasn't part of the Macintosh operating system.

The code for FSM was mostly written and shipped with two of Apple's foreign file systems, ProDOS for the Macintosh (part of the Apple IIe Card for the Macintosh LC support software) and Macintosh PC Exchange. However, the programming interface wasn't fully tested or documented.

In 1993, I was approached by Jack Valois, the engineer working on Macintosh PC Exchange, and he asked if we should announce FSM at Apple's 1993 WWDC. I explained that FSM had already been announced - in 1989 - and that if we were going to say anything about FSM to developers again, we should really mean it this time. Well, Jack and I worked to get support for the project from the testing, marketing/evangelism, and publications groups at Apple and after they all promised support, Jack (re)announced FSM in May at the 1993 WWDC. We seeded key developers with FSM right after the conference. Two months later, Apple had a series of layoffs and the promised support from other groups was... gone.

Left with just minimal engineering support and developer support, we could have told developers that we were just kidding about FSM again. Instead, we threw ourselves on the sword (again). Jack, Don Brady, and I tested the programming interface, Jack, Don, and I fixed bugs found by our testing and by seeded developers, and I wrote all of the documentation, answered developer questions, put together seed packages, and emailed developers the latest seed package. In late 1994, the FSM software development kit shipped on Apple's developer CD and later, System 7.5.1 shipped with the tested version of FSM built into the system.

You can download the File System Manager SDK from Apple's ftp server. The File System Manager was written by Bill Bruffy, Joe Buzek, Kenny SC Tung, Jack Valois, Michael Tsao, Brendan Hahn, Don Brady, and Jim Luther.

Technical Notes

At Apple, documentation is usually published as a book and is not touched until the next major revision of the book. When the Developer Support group gets questions because the documentation is wrong or incomplete, or because developers couldn't find and fit the information given in various places together into a working program, we wrote documents called Technical Notes or Technotes (as they're called today). Some Technical Notes are short, some are long, but all are as essential to developers as the official documentation.

I wrote quite a few Apple II Technical Notes, but they are probably getting hard to find these days. The last place I saw them, they were in the file Essentials.sea on an old Apple Developer CD.

The Macintosh Technical Notes I wrote include:

You can get to most of those Technical Notes on Apple's Web server.

AppleShare API Documentation

One of the first Macintosh projects I worked on was the System 7.0 Macintosh File Sharing/AppleShare 3.0 project. The AppleShare team added a simple programming interface to the new server software that allows developers to both find out what the file server is doing and control certain aspects of the server's operation. File Sharing shipped with System 7.0 in May of 1991 and later that year, AppleShare 3.0 shipped. However, there was no developer documentation for the new programming interface and nobody was working on it.

I took the engineering specifications for the AppleShare programming interface and the specifications for the new extensions to the AppleTalk Filing Protocol, and started to write a really big Technical Note. Fortunately, when I was about 90% done with my Tech Note, the AppleShare publications group decided to help me out. They took my outline and the drafts I'd written, assigned a writer, editor, and artist to the project, and finished the documentation. In the meantime, I cleaned up the assembly, Pascal, and C header files and wrote sample code for the documentation.

The result is the AppleShare API software development kit which can be found on the Mac OS SDK CD-ROM series. The AppleShare API SDK is available online in several downloadable pieces.


Tested* programs I've written

Most of the time, I write code that isn't directly useful for end-users (i.e., sample code). However, every once is a while, I write a program that is actually useful. Two of those programs, UnmountIt and Server Remote Control, are released as sample code. Another program I wrote that you may find useful is the AppleShareSetup control panel.

* I consider these programs to be tested only because large numbers of users have used these programs for 3 years with no complaints.

AppleShareSetup

AppleShareSetup lets you control those annoying (but informative) AppleShare alert dialogs - dialogs that say things like "You will no longer be disconnected from the file server" or the greeting dialogs some administrators want you to read. With AppleShareSetup, you can choose to see those messages, see them for a set time and have them auto-dismissed, or not see them at all. You can download AppleShareSetup from Apple's ftp server as part of the FsID package, but you'll get an old version that doesn't work with Mac OS 8.

AppleShareSetup 1.0.1 quit working with Mac OS 8 because the AppleShare Chooser extension has a new creator type. I've update the code to work with the new AppleShare Chooser extension, and you can download AppleShareSetup 1.1 from my directory on mac.com. A better alternative might be Apple's AppleShare Client Setup 1.0 program which supports more features with the latest AppleShare clients.


Malph 3.0

Nitin Ganatra, a friend of mine, wrote a shareware program launcher called Malph (for lack of a better name). He's too lame to get his own web page, so I told him I'd make the latest version of Malph available here. Tell Nitin you saw him here.

Click here to download Malph 3.0.

Here's a full description of Malph 3.0.

Use Malph to launch applications, open folders, mount AppleShare volumes, open documents with applications, and much more. Malph 3.0 continues the tradition of supporting the latest Apple technology by including support for the Appearance Manager, Navigation Services, Contextual Menus, and deep icons available in Mac OS 8.5.

Malph 3.0 is provided as a compressed, self-mounting, Disk Copy disk image. Just double-click Malph3.0.smi after downloading it.

Malph 3.0 supports several new features:

Malph 3.0 is Shareware, which means if you use it you must send Nitin US $12 per copy (either per user or per machine, your choice).

Please use the enclosed Register application in order to register your copy of Malph. You need to enter your name, email, postal address, and the shareware you wish to pay for. You may use any of a number of credit cards, personal checks, etc. to pay for Malph (check out the Register application for details.)

Pricing on site licenses is available via the Register application as well. If you have specific questions about obtaining a site-license, please email Nitin at malph@kagi.com.


Made on a Mac

Mac and the Mac logo are trademarks of Apple Computer, Inc., registered in the U.S. and other countries. The Made on a Mac Badge is a trademark of Apple Computer, Inc., used with permission.

Built with BBEdit

Back to top of Page