About | Buy Stuff | Industry Watch | Learning Curve | Products | Search | Twitter
Home » Products » Reviews » The Very Ugly

BatChmod 1.37

Arbysoft
Rating: (four burnt toasts)

Renaud Boisjoly

Collateral damage:
Outlay for upkeep of Batcave
Anywhere from 128 KB to 4.1 MB
Hours wasted doing something that takes seconds



Good afternoon and thank you for calling the Batcave! How may we help you today? You want what? BatChmod? Que? You do know there's another way that's easier, don't you? As in opening T-E-R-M-I-N-A-L and typing the following s-l-o-w-l-y and c-a-r-e-f-u-l-l-y?

chmod -R <new mode> <directory>
chown -R <new user>:<new group> <directory>

In fact if you wanted to do both at once you could make a script. And if that script is called chmodown you'd do something like this.

chmodown <new mode> <new user> <new group> <directory>

And the '-R' for 'recurse' would be assumed.

And the above method would take you but ten seconds to implement and significantly fewer seconds to run. So you're set now, right?

No! If things are this easy you are never set! If there's even the remotest possibility that you can still screw things up you should investigate the matter! Too right!


So let's wander over to the Batcave and take a download of BatChmod. Despite its name BatChmod will also (indirectly at least) apply ownerships to all affected files. And in all honesty BatChmod does more than call chmod and chown internally.

It calls them externally.

It also calls chgrp, chflags, chgrp, chmod, rm, sysctl, and tcsh - but it doesn't call them programmatically: it calls them from the command line.

Just like you decided not to do.

0000000000007c70 /bin/rm
0000000000007ca8 /bin/tcsh
0000000000007cd0 /usr/bin/tar
0000000000007ce0 /usr/sbin/sysctl
0000000000007cf8 /bin/chmod
0000000000007d8c /usr/sbin/chown
0000000000007dd4 /usr/bin/chgrp
0000000000007e58 nouchg
0000000000007e60 /usr/bin/chflags

It even calls the Cocoa file manager's changeFileAttributes:atPath:. And if permissions don't allow, it calls the Apple authorisation services.

0000000000007cb8 system.privilege.admin

BatChmod has a wild class called PrivilegeFetcher. It does a lot of things. It's wild.

000000000000b5a3 -[PrivilegeFetcher application:delegateHandlesKey:]
000000000000b5d7 -[PrivilegeFetcher application:openFile:]
000000000000b601 -[PrivilegeFetcher modPath:]
000000000000b61e -[PrivilegeFetcher applicationWillTerminate:]
000000000000b64c -[PrivilegeFetcher applicationDidFinishLaunching:]
000000000000b67f -[PrivilegeFetcher selectPath:]
000000000000b69f -[PrivilegeFetcher setCurrentUser:]
000000000000b6c3 -[PrivilegeFetcher selectUser:]
000000000000b6e3 -[PrivilegeFetcher getGroupList:]
000000000000b705 -[PrivilegeFetcher getUserList:]
000000000000b726 -[PrivilegeFetcher makeChmod:withButtons:]
000000000000b751 -[PrivilegeFetcher setChmod]
000000000000b76e -[PrivilegeFetcher setChgrp]
000000000000b78b -[PrivilegeFetcher setChown]
000000000000b7a8 -[PrivilegeFetcher expandedPaths:]
000000000000b7cb -[PrivilegeFetcher validateMenuItem:]
000000000000b7f1 -[PrivilegeFetcher applyValues]
000000000000b811 -[PrivilegeFetcher doneApplying:returnCode:contextInfo:]
000000000000b84a -[PrivilegeFetcher didEndCloseSheet:returnCode:contextInfo:]
000000000000b887 -[PrivilegeFetcher setValues:]
000000000000b8a6 -[PrivilegeFetcher klearPrivileges:]
000000000000b8cb -[PrivilegeFetcher getPrivileges]
000000000000b8ed -[PrivilegeFetcher setCurrentFileType:]
000000000000b915 -[PrivilegeFetcher currentFileType]
000000000000b939 -[PrivilegeFetcher filePathContainsWildcard:]
000000000000b967 -[PrivilegeFetcher enableControls]
000000000000b98a -[PrivilegeFetcher disableControls]
000000000000b9ae -[PrivilegeFetcher awakeFromNib]
000000000000b9cf -[PrivilegeFetcher toggleAuthorization:]
000000000000b9f8 -[PrivilegeFetcher reallyEmptyTrash:returnCode:contextInfo:]
000000000000ba35 -[PrivilegeFetcher emptyTrash:]
000000000000ba55 -[PrivilegeFetcher setMyPath:]
000000000000ba74 -[PrivilegeFetcher dragPath:]
000000000000ba92 -[PrivilegeFetcher updateCLIEquivalent]
000000000000baba -[PrivilegeFetcher donate:]
000000000000bad6 -[PrivilegeFetcher applicationShouldTerminateAfterLastWindowClosed:]

To assist in getting all those behind the scenes Terminal programs running smoothly it has another class - another doozy.

000000000000bba7 -[TaskMaker runTaskUnlockRecursive:]
000000000000bbcc -[TaskMaker runTaskChgrpRecursive:withGroup:]
000000000000bbfa -[TaskMaker runTaskChgrp:withGroup:]
000000000000bc1f -[TaskMaker runTaskChownRecursive:withUser:]
000000000000bc4c -[TaskMaker runTaskChown:withUser:]
000000000000bc70 -[TaskMaker runTaskChmodRecursive:withPrivileges:]
000000000000bca3 -[TaskMaker runTaskChmod:withPrivileges:]
000000000000bccd -[TaskMaker authenticate]
000000000000bce7 -[TaskMaker fetchPassword]
000000000000bd02 -[TaskMaker deauthenticate]
000000000000bd1e -[TaskMaker isAuthenticated]
000000000000bd3b -[TaskMaker dealloc]
000000000000bd50 -[TaskMaker init]
000000000000bd62 -[TaskMaker runTask:]
000000000000bd78 -[TaskMaker runTaskRemoveRecursive:]
000000000000bd9d +[TaskMaker sharedInstance]

And it gets back notifications as well.

000000000000bdcb _TaskMakerAuthenticatedNotification
000000000000bdef _TaskMakerDeauthenticatedNotification

If fires were fought like this no buildings would stand. All you'd see every day would be smoke - for miles.

Zing! Zing!

Subtotals time.

The initial download is 2.8 MB. The package has 352 items. But if you take out what you don't need you get it down to 9.

The initial download expands to 3572172 or 8352 blocks taking an effective 4276224 bytes - but when you get it down to only those 9 items it takes only 120492 bytes or effectively 128000 bytes, a savings of almost the whole ball of wax.

The executable is not only 'fat' - it's also a debug image. So you get it down from 245516 bytes to 48748 - but then you have to know how to use your T-E-R-M-I-N-A-L of course.

BatChmod has lots of localised files. Inasmuch as you're probably going to run it in only one language you can dispense with the superfluous ones. An 'r' or a 'w' or an 'x' is the same in any language. As with Unix.

And if you don't need the tutorial on what modes and ownerships mean you can get rid of another 232947 bytes (effective 280000 bytes).

It all adds up. Or subtracts down. And you're left with 128 KB on disk. From an initial 4.1 MB. And from an even earlier 0.

This to change file modes and ownerships and deal with the occasional user flag, run a shell, zip some stuff, whatever.

The point is: it's only doing what you would have done - from the command line. It's not doing it programmatically - it's invoking the same commands you would have invoked the same way you would have invoked them.

So what do you need? Do you need to reset modes and permissions on files throughout your home area? Developer boxes at Rixstep do this by script several times per hour. Each run takes about five seconds real time. It's all automated. It's as easy as repairing permissions - but a thousand times safer.

And you could do it too: you could start by making that chmodown script mentioned earlier. Which as stated would take you all of about ten seconds to have ready. And then you could run your script anytime you wanted, setting modes and ownerships any way you wanted.

Just like that. Insanely great.

Or you could decide the easy way out is not the wise thing to do. You could instead download BatChmod, spend an hour or two rifling around removing junk, extracting the binary you want and then stripping it, removing extraneous Interface Builder files and other flotsam and jetsam - to be smacked with a mere 128 KB loss.

Or you could say to yourself: 'hey what's 4 megabloats when I got so much disk space'. And you could repeat that over and over until you believed it. Get a rhythm to it. Put in your best Richard Simmons and work out to it. And if you were lucky your parent or guardian wouldn't overhear you mumbling your mantra and have you committed.

PS. But hey - this isn't to disparage the creators of BatChmod - on the contrary: they're intelligent to recommend good products that can take over when their own fall short. Such as this one. Try it - it's a real gem too.

Thank you for calling the Batcave. To entertain staff your call was monitored.

About | Buy Stuff | Industry Watch | Learning Curve | Products | Search | Twitter
Copyright © Rixstep. All rights reserved.