Direct file versioning

Another thing I've wanted for a long time is integrated file versioning (if possible coupled with pervasive auto-save). It looks like the new Mac OS X versions will have it. Apple apparently has the knack for getting things right.

I have no idea how the feature is implemented in MacOS X Lion but I would do it with multiple file streams, with a simple addition of an API which makes one of the streams the "default one". This way, new file version creation is simply a combination of "create new stream" + "make it the default one" + "write data as usual to the file".

Ironically, Microsoft's NTFS had multiple file streams probably since it was first created, but no serious applications use it (maybe because it lacks an easy API?). Unix file systems traditionally don't implement this feature, but ZFS might be in an ideal position to implement it, and not only for whole-file-copy versioning but it could also be integrated with its COW and deduplication, writing only modified file data.


[for information completness, some ancient file systems like the VMS's had file versioning, and the ISO9660 file format for CD-ROMS have a similar implementation, but that feature was essentially lost for mainstream systems until now]

#1 Re: Direct file versioning

Added on 2011-03-03T00:54 by Justin Sherrill

There's DragonFly's Hammer file system, though this may not be exactly what you are looking for. It effectively saves with every fsync.

#2 Re: Direct file versioning

Added on 2011-03-05T22:56 by wenda

right now i'm playing with nilfs2 in linux (netbsd has it too). worthwile to look at it.

#3 Re: Direct file versioning

Added on 2011-03-06T07:43 by MichaelWH

Apple has a knack for getting it right? For replicating technology from the '80s? I was using (and enjoying) automatic file system versioning in my computing when I started university an embarrassing number of years ago!

#4 Re: Direct file versioning

Added on 2011-03-06T16:28 by sleepless

When I need file versioning, I just initialize a mercurial repository in the directory and add all (needed) files and start a cronjob/while true; sleep 60; hg commit; done

It works totally awesome and doesnt need any hacking.

#5 Re: Direct file versioning

Added on 2011-03-08T22:22 by Florent Thoumie

Yeah, cause that's exactly the same thing.

Comments !