CVS with AppleSingle files

Longtime Apple developers probably know this intuitively, but I needed some time to figure it out: When CVS-ing files with a resource fork, you must not use the /usr/bin/cvs that ships with OS X!

Because Apple used to separate data and metadata, most files in the pre OS X era had a data fork and a resource fork, but for the user this was transparent; the user just manipulated one file. Tools without this “Classic” background know nothing of the resource fork. Files without data fork appear in the Terminal to have 0 bytes.

CVS is one of these tools that is ignorant of resource forks. For such cases there is the AppleSingle file format (see RFC1740); it is common to put files with a resource fork as AppleSingle file into CVS. To not bother the CVS user, Mac CVS clients like MacCvsPro, MacCvsX or MacCvsClient perform the necessary conversions transparently.

Usually you can accomplish more and have more power on the command line, but in this case it is much easier to use MacCvsPro, MacCvsX or MacCvsClient than the command line. There exist some scripts (applesingle.py and single2forks.pl) to help out command line users, but I was lazy and didn’t try them.

This entry was posted in OS X/Windows/Linux, Programming, Tips. Bookmark the permalink.

Comments are closed.