posted by Henrik Petersson on Wed 14th Apr 2004 21:15 UTC
IconI created the Casper project because I needed a way to organize my growing collection of CD-R/RWs which holds a lot of music and images, but there was no such solution available for my OS of choice, the BeOS.

I didn't have to think hard to come up with an easy-to-implement and easy-to-use solution. I already had the "database", the Be File system, and I already had the interface, the Tracker, which is the BeOS file manager. The only thing that I needed was an application that would read the file information from the CD's and store it on the hard drive, then later tell me which CD the files are stored on.

Casper was born.

Ghosts with fancy attributes

I will now give you two examples of how Casper can be used: a photo database and a music database.
The Casper UI is pretty straight-forward. To the left you'll see a list of available volumes, both removable media and hard disks. And to the right you'll see a list of storage locations where Casper will store the information.

I start by creating a new storage location. The storage location can either be a folder or a virtual partition(BeFS image). Folders are used for files that should always be searchable, while virtual partitions are used for files which should be easy to separate from the rest of the files on the system.
In this case I'm choosing a folder location for my images.

Casper When I'm done creating the storage location I get the stack of CDs, containing my photographs, from the shelf and put the first one in my CD-drive to see it appear in the volume list. I select the CD as my source and the newly created storage location as my destination then press the Go! button.

What Casper does now is to create empty versions of all the files on the CD and store them in the specified folder on the hard disk. All the names and attributes of the files and folders remains the same, the only difference is that the files contain no data.
However, in the process Casper added a few extra attributes to the files. Those attributes describes information about the media which the files belong to such as the name of the CD, the path to the file on the CD and a user-defined note about the media(not yet implemented). Additionally Casper also registered its friend application Wendy as the default application for the files.

I repeat the same procedure for every CD in my photo collection. Then I do the same thing with my collection of MP3-CDs with the only exception that I in that specific case will use a virtual volume as the storage location instead of a folder.

Waking the dead

Pointing the Tracker to the folder where I stored my photographs I will now see all my pictures there with thumbnails and everything, since the thumbnails are stored as attributes as well. Thanks to the fact that each and every file contain information about which media they belong to , I can easily move them around in any way that I desire. I can even move them between partitions and mix them all together. I have the freedom to easily organize them in a better way.

A Query The files are also searchable right from the Tracker's Find panel just like any regular file. You'll be able to search for audio files using attributes such as 'Artist' and 'Album' and for pictures using 'Location' and 'Colors' for example. The latter two are my own extensions.

Here's where the difference between the two storage location types comes in. If I let Casper store the files in a folder on my main partition these files will be considered each time I search that partition. Storing the files on a virtual partition will allow me to search among those files specifically and even leave the partition unmounted and only mount it when I need it.

The Wendy Dialogue When I double click one of the files it will open up in the preferred application, which as I explained earlier is Casper's buddy Wendy. Wendy reads the information about the file and displays it in a dialogue. You then either close the window or insert the requested media. If you insert the media, Wendy will launch the file from the media into the default application, or execute it if it's an executable file. There's also an option to open the parent folder instead of launching the file.

The return of the zombies

No tool is perfect. Casper has some issues, and here's a few of them:

1. Drag&Drop won't work with these files, neither will the "Open File" dialogue in applications. I can think of many possible solutions for this problem for example pipe-like features, translator add-ons or even tracker add-ons. But I won't go further into them this time, because I need to investigate them more.

2. Casper-generated files can easily be mixed up with regular files if the file size information isn't visible. I will try to solve this by adding Casper emblems to file icons in a future version.

3. The possibility of moving files around makes it harder to update a rewritable media. I will try to solve this in a later version, but for now updating a media could result in duplicated files.

I welcome any suggestions to issues that a solution like Casper might create. Even though Casper works fine for my personal needs, I want it to be usable to more people.

However, my main point of this article wasn't to show off my little application, but to show that the underlaying features of the operating system such as the file system might provide aimple solutions to many problems.
Instead of reinventing the wheels at application level, or use alien tools or libs, even a lousy programmer like me was able to quickly create a working solution using the features that the operating system provides.

Here are a few examples of other apps that takes advantage of the BeFS:
IM Kit
Remote Session
BeAndSee
Mail Daemon Replacement

About the author:
I am 25 years old and located in the south of Sweden. I ran a large music community on the web for about six years but had to close it a year ago due to financial reasons. Now that I'm unemployed I spend my time practicing my main interests in life: music, photography, poetry, graphics design, cooking, politics and computers.


If you would like to see your thoughts or experiences with technology published, please consider writing an article for OSNews.
e p (0)    28 Comment(s)

Technology White Papers

See More