Hacker News new | ask | show | jobs
by gwbas1c 69 days ago
Years ago I shipped a MacOS product. If you deleted it, you would get an error emptying the recycle bin (or force-deleting the application bundle if you did an rm -R to it.)

Why? Well, at the time Windows Explorer had an API for extensions, but MacOS didn't for Finder. We needed to add some menu items to the context menu, which on MacOS required reverse engineering Finder and injecting code into it. This then meant that Finder had an open file handle into our application bundle until you either restarted Finder or restarted MacOS. Then, as long as you didn't start our application, you could cleanly delete it. (Thankfully MacOS cleaned this up with the Finder extension API about a decade ago.)

Having gotten familiar with internals of both Windows and MacOS... MacOS has its own set of gremlins too.

5 comments

Shell extensions are the single most common cause of Explorer crashes according to Raymond Chen.

When you realized that Mac OS X didn’t have an equivalent API, did you perhaps consider that it was for a good reason and that you should redesign your application to fit the conventions of the system? How did you conclude that your UI was oh so special that it deserved horking up the Finder experience for your users?

> How did you conclude that your UI was oh so special that it deserved horking up the Finder experience for your users?

Because that was the customer expectation, and our competitors did it too. (Including Dropbox, Box, and Google Drive.)

What we did was work a backdoor channel into Apple to "encourage" them to add an API. I don't know if it was our influence that did it, or the fact that they realized that blocking 3rd party integrations into Finder would be a considered a regression from the general public's POV, but they made their API and we adopted it.

I don’t understand. Any MacOS Finder that had an open file handle into an application bundle runs on the Unix version of MacOS, and that allows deletion of open files (the inode stays around until the process exits), doesn’t it?

Or did/does the Finder check whether to-be-deleted files are open? Or did I forget how older Mac file systems behaved?

If "years" means decades, it would have been classic MacOS which played by a very different set of rules.
Finder does check this, yes. You can't delete open files in Finder.
It was an open file handle on Unix OSX to a dylib.
> MacOS has its own set of gremlins too.

You can't really blame macOS for this one. Interesting to hear this isn't just a Windows thing though.

You really can, considering that a Windows program would not have had that issue.
How is it better on Windows? It doesn't do anything to prevent third-party software from injecting into system processes.
You seem to be blaming the OS for how you broke it?
As a mac user for 10+ years that cycled about 7 macs for personal and professional use, I've used Finder about biweekly to click on the airdrop button..
Please enlighten me on the alternatives (I hope it's not just iTerm2)
it's zsh with about 300 lines of zshrc.

I know exactly where everything is, and `find` and associated aliases works perfectly when I don't.

You might enjoy croc and other implementations of the Magic Wormhole.
Midnight Commander inside iTerm2 :)