Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

  (email not shown publicly)

Journal of Alias (5735)

Thursday June 28, 2007
10:17 PM

Deleting a file no longer requires voice synthesis support

[ #33632 ]

Because I maintain a lot of file utility and installation type modules, I care quite a bit about the ability to say "delete that" and just have it Do What I Mean on any operating system.

So I'm the current maintainer of File::Remove, which lets you do that specific task.

During a period that someone else was maintaining it, it also picked up "Trash" support. That is, it has a function called "trash" which lets you delete a file (recoverably) to the Mac OS X trash bin, or to the Windows recycle bin.

While it's a neat feature it's always been a bit icky in terms of it's dependencies. When we got Strawberry Perl working and turned out attention to the CPAN modules, one of the things that didn't install was a module needed on Windows to allow for Recycle Bin support.

The trash function also doesn't work on Linux...

I've never really had any negative feedback on this not working, it's just sort of a half-implemented crappy feature nobody used.

What I HAVE had occasional feedback on though, is that on Mac to install File::Remove, you also need to install Mac::Glue so that it can bind to Finder to do the Trash deletion. This installs Mac::Carbon, which is a large monolithic package that, amongst other things, spawns a calculator during testing and adds (and noisily tests) voice synthesis support.

Don't get me wrong, voice synthesis is kind of cool (although the Mac one is fairly crap) but I really don't think it should be necessary to install it in order to delete a file :)

So until it's done properly, the "trash" function really needs to die.

As a first step, I'm remove ALL the dependencies used by the trash function.

If you do use it, you need to add an extra dependency to your package, Task::RecycleTrash, which will make sure that the correct dependencies are installed for your operating system, and then test that the trash works.

Longer term, the trash functionality will probably migrate to somewhere like File::Trash or File::Recycle, although both those names have been reserved 3 months ago with null packages by prolific CPAN namespace squatter DMUEY.

In the mean time, now you can at least delete a file without having your Mac talk to you.

I'll probably also be taking a look at File::HomeDir as well in this regards, although that's a trickier case.

Ideally, I'd much prefer to see all the weird and strange stuff like speech recognition moved out of the core Mac::Carbon package into something seperate, so that the core Mac::Carbon is smaller and less obnoxious.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.