OSXSnarf: a simple file server capable of replacing /dev/snarf with the snarf buffer of your local OSX machine.


This is intended for use primarily with Plan 9 running under parallels. There is no direct way that I know of which is capable of linking OSX's copy/paste buffer with Rio's /dev/snarf but importing this and binding it before you run Rio will replace the normal snarf buffer with the one of your local OSX node.

The program is for OSX only however it is written to be a part of the P9P software (I may write a similar program for Lucho Ionkov's SPFS library in the future). You can drop it in $PLAN9/src/cmd/ and do:

	$ mk o.osxsnarf
(thanks to Russ Cox for pointing AUTOFRAMEWORK to me)

Download:

osxsnarf.c -- source


Build:

Note: assumes P9P.
	$ 9c osxsnarf.c
	$ 9l -o osxsnarf osxsnarf.o -framework Carbon

Usage::

On OSX, assuming a standard NAT installation with the host network at 10.1.0.2:
	$ osxsnarf 'tcp!10.1.0.2!18001'
Then in Plan 9 within Parallels:
	% srv tcp!10.1.0.2!18001 snarf
	% mount -b /srv/snarf /dev
	% # start rio ...

Thanks:

This code borrows the OSX snarf code from Paul Lalonde's native drawterm port to OSX.

Bugs:

Quite likely I'm not dealing properly with snarfs near or larger than the snarf buffer.

Security lacking: there's no security. Please do not bind the server to any ports exposed to the world wild web, use only the internal parallels one.


Last Modified: May 29, 2007
mirtchovski at gmail