tisdag 10 mars 2009

Obscure file formats begone!

I am very pleased. It seems that Apple are realising what the Open Source world realised a long time ago: inventing your own file format for everything just wastes a lot of time and will only keep the applications on the computer to be separate islands with very little cooperation. An, for the user, this is always a very bad thing.

Instead, it seems that more and more Apple is realising that there are good alternative already developed for storing structured data. The famous .plist are just XML files, which you may edit in any text editor to your hart's content. Why complicate things? Adress book, and I think all the things does more heavy data mangling (like the new iPhoto) are just packaged SQLite3 files. You can easilly test this yourself:

Just cd to the iPhoto library:

> cd Pictures/iPhoto\ Library
> echo ".schema"|sqlite3 face_blob.db
CREATE TABLE detected_face_blob (image_key int, face_index int, recogBuffer blob, histogram64Buffer blob);
CREATE TABLE face_name_blob (face_key integer, attrs blob);
CREATE INDEX detected_face_index_a1 ON detected_face_blob(image_key, face_index);
CREATE INDEX face_name_index_a1 ON face_name_blob(face_key);

> echo ".schema"|sqlite3 iPhotoMain.db
CREATE TABLE AlbumsPhotosJoin (sqAlbum INT, sqPhotoInfo INT, photosOrder INT);
CREATE TABLE GpsTracksEventsJoin (sqGpsTrack INT, sqEvent INT);
CREATE TABLE KeywordsPhotosJoin (sqKeyword INT, sqPhotoInfo INT);
CREATE TABLE MasterSchema (primaryKey INTEGER PRIMARY KEY AUTOINCREMENT, version INT, theSchema BLOB);
...
[OUTPUT TRUNCATED]


To me, it is not so strange that interaction between Mac apps runs smoothly.. it is all down to just asking questions in standardized / openly documented languages. Standards are good.. I like standards.

Inga kommentarer:

Skicka en kommentar