views:

31

answers:

2

I want my OS X app to share files via the loopback device. I want to do this so that my app can make a directory of frequently changing, read only files available to the user without messing with the users home directory. The files will be severed from the Application Support directory but the user will not have to concern themselves with this.

Apple recommend using an NFS server to do this (see the 'alternatives' section of this Q&A):

http://developer.apple.com/mac/library/qa/qa2001/qa1242.html

As far as I can tell nfsd must be ran as root, which I'd prefer to avoid (asking the user for a password whenever the app starts would be a horrible UX).

Is it possible to start an nfsd instance without root?

Are there any alternative NFS servers which I could include with the app? (I couldn't find any)

Are there any alternatives servers that I could use? (The server would have to be AFP, SMB or WebDAV as these are the protocols that Finder can mount - I couldn't find any such servers).

A: 

I'm not sure I understand your use case but have you considered using a file system mounted from an OS X disk image? Disk images on OS X are very robust and very flexible: you can pretty much have any kind of file system(s) created on one image and can mount or dismount them at will and at whatever mount point(s) you like. See the man page for hdiutil for more info.

If the "files" you are trying to serve are not actually disk files, then you might want to look at MacFUSE, the mostly widely used implementation of FUSE for OS X.

Ned Deily
A: 

Use MacFUSE. This is by far the easiest way to implement a file system.

Yuji