Troubleshooting Tools: File Utilities

Troubleshooting Tools: File Utilities

Originally posted August 2nd

Dan Frakes
July 2005

Our monthly Troubleshooting Tools column, penned by MacFixIt Contributing Editor Dan Frakes, covers products that can help you maintain and fix your Mac.

For the most part, you work with your files in Mac OS X, not on them. But there are times, especially during troubleshooting, when instead of editing the contents of files, you need to change file settings: permissions, file types, extensions, or even obscure attributes such as visibility. There may also be times when you want to manipulate files -- move them, rename them, and so on -- in a more efficient manner than can be done in the Finder. Here at MacFixIt, we're frequently asked how to make such changes without resorting to Terminal or obscure developer tools. In today's column, I'm going to talk about some of my favorite utilities for working with files. These definitely aren't the only such utilities out there, but they're the ones that I think stand out -- and the ones I turn to when I need to get something done.

Note: This article assumes that you know what most file attributes -- file permissions, owners, and groups; type and creator codes; filename extensions; invisibility, etc. -- are, but you just want some tips on how to work with them. More info on some of these topics can be found in our Tutorials section, including articles that cover permissions, invisible files, and, tangentially, file types and extensions.

BatChmod Mac OS X's own Get Info window lets you change the owner, group, and corresponding permissions of a file or folder, but it has a couple significant limitations: First, when working with a folder of files, clicking the "Apply to enclosed items" button does change the permissions of enclosed files, but sometimes it doesn't change the Owner and Group settings. (And unless you're the owner of the files/folders in question, it won't even let you apply the permissions.) Second, you can't modify the "execute" privileges of files via Get Info. If you really need to recursively change owner or group ownership of a directory of files, and/or their permissions, a better approach is to use Renaud Boisjoly's donationware BatChmod. Named after the Unix command chmod, which is used to change permissions on files in Terminal, but pronounced "batch-mod" for its ability to recursively apply such changes, BatChmod is both effective and easy to use. You simply drag a file or a folder of files onto the BatChmod icon or window (or click the File button and navigate to the file or folder); choose the desired Owner, Group, and privileges, enabling the "Apply ownership and privileges" option for enclosed files and folders, if desired; and then click the Apply button. If the change requires administrative authorization, you'll be asked for your admin-level username and password. Note that you cannot modify the permissions of locked files; by enabling the Unlock option, BatChmod will unlock any locked files first and then perform the desired changes.

BatChmod folder permissions screenshot

BatchMod also has one other, slightly hidden, feature that can be quite useful: If you've got a stubborn file or folder in the Trash that refuses to delete, the Force Empty Trash command will do just that after you provide your username and password.

FileXaminer and XRay If your file finagling needs are slightly more demanding, and you're willing to spend a few bucks for a more powerful tool, you'll want to check out Rainer Brockerhoff's $10 XRay and Gideon Softworks $10 FileXaminer.

Both utilities allow you to change settings available via the Finder's Get Info window, but both also go much further. Like BatChmod, you can set the execute privilege and propagate privileges to the contents of folders, but XRay and FileXaminer also provide you with the actual code you would need to type in Terminal to achieve the same result -- for example, CHMOD 644 for "read and write" for the owner and "read only" for everyone else -- which is useful for those trying to understand the chmod command. FileXaminer also provides a pop-up menu of common permissions presets such as "Owner Private" (full access for the owner, no access for anyone else).

In addition to permissions, both utilities also allow you to edit special attributes such as visibility, UID, GID, sticky bit, and, in the case of XRay, even the more obscure flags: immutable, append, nodump, and opaque. (Don't worry if these attributes don't make any sense to you -- if they don't, you shouldn't be changing them.) You can also change creation and modification dates, as well as file extensions and OS 9-style File Type and Creator Codes, manually or via pop-up menus that list possible values. XRay is especially helpful with respect to file extensions, types, and codes, as it shows a "flow chart" that illustrates how Mac OS X determines which application should open a particular document: first the OS checks for a specific application binding, then it checks for a Creator Code, then a file extension, then a File Type.

XRay File Type screenshot

Both utilities also provide unique options. For example, XRay's file browser lets you browse your hard drive(s) via a familiar "column view" interface in order to choose files to "XRay"; however, since the file browser displays invisible files, it allows you to work with files you wouldn't normally be able to see in the Finder. You can also install XRay's contextual menu plugin to "XRay" a file by control/right-clicking on its icon and choosing the XRay item in the resulting contextual menu.

FileXaminer provides the additional ability to open files or their icons directly in a hex or icon editor, respectively, but it also hides some extremely powerful options in its Special menu. The Super Delete command deletes the currently "examined" file permanently, no matter its ownership or permissions (provided you're an administrator, of course); this feature is also available via FileXaminer's contextual menu plugin, which makes it my favorite way to delete a stubborn file in OS X. Admin users can also edit any text file as root from within FileXaminer, and -- be careful here -- manage users and groups without having to use NetInfo Manager. Finally, the utility's contextual menu also lets you copy the full path to a file to the Clipboard.

FileXaminer Special Menu screenshot

This is just an overview of the most significant features of these two excellent utilities; both provide other features and functionality, as well. Suffice it to say that XRay and FileXaminer are among the first utilities I install when I get a new Mac. I find them to be invaluable troubleshooting and file management tools.

FileBuddy As useful as I personally find BatChmod, XRay, and FileXaminer to be, I realize there are few users who frequently need to work with advanced file attributes. Rather, most users' file needs revolve around moving, copying, deleting, renaming, and finding. Although there are a good number of utilities out there that can perform individual file-related tasks, and a few that combine several such tasks into a single app, it's tough to beat SkyTag Software's feature-laden File Buddy. At $40, File Buddy costs more than some of these lesser utilities, but it offers more file-related functionality in one package than any other utility I've seen. It includes much of the functionality of XRay and FileXaminer along with an array of more "general" file/folder actions. For example, when you first drag a file onto File Buddy, you're given the following options for action:

File Buddy's Open options

As you can see, these "quick action" options are the kinds of things a typical user might want to do on a file or, more likely, a group of files: moving, copying, renaming, deleting, etc. But if you choose the Get Info option, you get the full File Buddy info/action window:

File Buddy's Info window

The number of visible options here is impressive, and include the ability to change nearly any file setting, from permissions to dates to invisibility; you can even delete the data and/or resource fork of a file. And if you drag a group of files onto File Buddy, you can change them all to have the same attributes; if you have a particular file you want to use as a model, you can choose that file and tell File Buddy to change the attributes of other files to match it. Once you've made your changes, you simply click the Save button (for changes to a single file) or the Change All button (for changes to a group of files).

The icons at the top of the info window provide many additional options. For example, you can rename a large number of files using dates and times, sequential numbers, or any set of criteria you define -- for example, you can replace particular words or phrases with others, add prefixes, and even convert case:

File Buddy's Rename dialog

File Buddy's menus also reveal a number of useful features, especially the Cleaning menu, which lets you quickly find duplicate or unique files, invisible files, and orphaned files (those whose creators aren't installed on your Mac); scan for unused preferences files and files that contain no data; and erase unused hard drive space to prevent "deleted" files from being recovered. You can also take a "snapshot" of your drive and compare it with a previous snapshot -- for example, if you take a snapshot before and after you install software, the resulting comparison will show you exactly which files were installed and where. (This is useful not only for keeping track of installations, but also for removing a software package that didn't come with with an uninstaller.) File Buddy also has extensive Find functionality that lets you search for files based on multiple criteria, much like the Finder's search feature; the advantage here is that after you've found files using File Buddy, you can use the utility's many features on the results of your search.

Finally -- mainly because I'm running out of space in this month's column -- File Buddy has two other killer features that make it especially useful. The utility's Administrator mode, available to admin users, lets you easily move, delete, and otherwise work with files which you normally wouldn't be able to see and/or wouldn't be able to access. And if you think you'll be performing a particular set of actions more than once, you can create a Droplet that performs the desired action on any file(s) dropped on it. So if you tend to use File Buddy's rename feature to rename the photos from your digital camera each time you download new pictures, you can create a Droplet that performs that renaming work and then save the Droplet to your Desktop; whenever you have new photos, you simply drag them onto the Droplet.

Between these four utilities, you should be able to perform nearly any action on any type of file, whether you're looking to change basic file attributes or perform complex file renaming and management. And at prices from free to $40, there's something for every budget -- although you do get what you pay for in terms of functionality.

(Got a favorite file utility that you like better than the ones here? Let us know in the comments below!)

Contributing Editor Dan Frakes is a former MacFixIt Editor, and is currently Senior Writer for Macworld and Reviews Editor for Playlist. To provide feedback on this column, or to suggest utilities for future columns, drop Dan an email at his address: dfrakes.

  • More from Tutorials