Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Share any folder or volume via Filesharing! Network
We've had the ability to create share points when using personal file sharing for quite some time. Simply click a folder and select File -> Sharing, set your options, and go. With OS X, that functionality seems to have disappeared. According to Apple, we need OS X Server for this, but that is not so. Here's how you can create your very own share points in Mac OS X:
  1. Open NetInfo Manager and authenticate.
  2. Create a new subdirectory in /config/SharePoints/ (click on config, then on SharePoints, then select Directory -> New Subdirectory).
  3. Set the name value to be what you'd like the share to be called (double-click on the Value column next to name).
  4. Add a new property (Directory -> New Properyt) and name it directory_path.
  5. Add a new value for directory_path. The value needs to be the path of the folder or volume (for example, /Users/username/Pictures).
  6. Save your changes in NetInfo.
  7. In the Finder, set the privileges on the folder or volume you'll be sharing. Do Show Info, then Privileges, and pick what you like -- Drop Box, Read Only, etc.
  8. Stop and restart the AFP Server from the Sharing preferences panel.
  9. Connect from a client and they will see the new share.
Notes: Users with admin privledges may not see the new share point, since they can see all volumes from the top anyway. Also, if you share items with spaces anywhere in the path, do not quote or otherwise escape the spaces when you add the directory_path into netinfo. If the volume being shared is read only (a CD ROM, for example), then just skip step seven.

[Editor's note: This is probably the most useful tip I've seen in quite a while! I just tried it, and it worked exactly as described - my "Pictures" folder became available as a read-only volume to the AppleShare network - slick!. I wonder how difficult it is to wrap a GUI application around updating NetInfo?? That would be a killer OS X app!]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[87,554 views]  

Share any folder or volume via Filesharing! | 27 comments | Create New Account
Click here to return to the 'Share any folder or volume via Filesharing!' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
dev tools required?
Authored by: dreness on Thu, Nov 8 2001 at 8:33PM PST
At least one other person I've talked to about this doesn't even have /config in his netinfo... he doesn't have dev tools installed, as I do (and my hunch is that the editor does as well). Can anybody else without dev tools installed confirm this?

My friend (natan) tried creating /config and /config/SharePoints, then adding the appropriate properties and values as described on his system, but had no luck.

-dre

[ Reply to This | # ]
dev tools required?
Authored by: dreness on Thu, Nov 8 2001 at 10:18PM PST
I also nidump'd /config/AppleFileServer, and had my buddy without dev tools niload it... still no luck.

In any case, dev tools are freely downloadable from developer.apple.com, so anybody dying to use this hack can do so by simply installing dev tools.

-dre

[ Reply to This | # ]
dev tools required?
Authored by: dsauve on Thu, Nov 8 2001 at 11:07PM PST
This is some good stuff about using NetIno. How long will it take before there is a complete guide to all the NI database options? The lack of concrete directions on setting up mounts and exports etc. is a huge flaw in OSX. A concise guide to the essential functions would make all the difference. I've managed to get parts of it working, but there are obvious holes in what I need and what I have.

I did get a copy of OSX Server installed and played with it for a few weeks. What OSX lacks, Server has. They're basically the same thing, except for those configuration apps. In fact, I wonder if I could just copy those apps over to OSX and use them there.

The reason why I'm not using Server now though is because of the way Apple has configured Apache. The Apple version is very particular. And if I'm going to customize it anyway, why bother using Apple's with all the Server's overhead?

I bring the subject of Server up mainly for one reason. I noticed that when you fully configure your system using Server, the NetInfo database fields get populated. The special GUI apps that Server has end up storing everything in NI anyway. So really, one could set up Server using the gui, and then document what fields are generated and what values the fields get. Then with that info, you could populate NI w/o spending the $ on Server.




[ Reply to This | # ]
netinfo docs
Authored by: dreness on Fri, Nov 9 2001 at 12:04AM PST
Apple has a fairly in depth exploration of netinfo available here: UnderstandingUsingNetinfo.pdf. Also, man 5 netinfo has more specific information about what you'll find in the netinfo database (though it doesn't address the additions made by the dev tools...) hope this helps, -dre

[ Reply to This | # ]
netinfo docs
Authored by: dsauve on Fri, Nov 9 2001 at 5:40PM PST
That NI doc isn't much help. It's mostly high-level. Were you able to set up domains using it? I wasn't. The Server Admin guide goes into more detail and shows step by step how to set up the Server features, but I get lost trying to set up the DNS and bind stuff. And from what I can tell off the Apple Server forums, local networks need a DNS for domains to work. That's why I gave up on Server for now.

At the moment, I'm trying to figure out how to export my Users mount to other machines ... it mounts fine at startup using fstab, so I tried setting up an /etc/export file but that didn't seem to work. So I'm guessing I need to use NetInfo ...

Like I wrote eariler, the Admin guide goes into detail about setting up NFS and AFP ... I'll probably have to configure it in Server-land, figure out how NI is modified, and then use that in regular OSX. Backwards engineer it.




[ Reply to This | # ]
dev tools required?
Authored by: mert on Wed, Nov 14 2001 at 1:28PM PST
I was able to get this to work without having dev tools installed. It worked the first time and I did not have to deviate from the directions.

Regarding NetInfo...
I'm with dsauve, where does one get some "meaty" documentation about NetInfo? That PDF from Apple (Understanding and Using NetInfo) is too high level. I want to know what all the available properties and values are, and what they are used for. How was this sharepoints hint figured out? Trial and error? Mimicking what OS X Server did?

All you NetInfo gurus (or wannabees), please have a look at this thread on the Apple Discussion board (you can probably skip down to message #9) and help out if you can:

http://discussions.info.apple.com/webx?128@170.7gYDaMLmmdK^1@.ef7d12d

Thanks!

[ Reply to This | # ]
dev tools required?
Authored by: echo on Fri, Nov 9 2001 at 5:23PM PST
Without dev tools installed, I have /config/SharePoints/ (10.1).

[ Reply to This | # ]
dev tools required?
Authored by: kerim on Sun, Dec 2 2001 at 9:55AM PST
I just bought an iBook with 10.1 (now 10.1.1) and this does not work. I have not yet installed Dev Tools.

[ Reply to This | # ]
Easy AFP Reset
Authored by: jkemp on Tue, Dec 11 2001 at 3:32PM PST
This small script will automagically reset the AFP server for you. Just type it into a text file using pico or your favorite editor, and save it as something like resetafp. Change it to be executable by you (chmod 700). You must either be root or use sudo to run it, as AppleFileServer is a root daemon.

Alternatively, you could add the sudo command at the beginning of the two command lines in the script if you don't want to have to type it every time you reset. :-)


#!/bin/sh
kill -9 `ps x | grep AppleFileServer | awk '{print $1}'`
nohup /usr/sbin/AppleFileServer &


[ Reply to This | # ]
Easy AFP Reset
Authored by: scot on Wed, Nov 27 2002 at 10:05PM PST
You work too hard, just use the .pid file...

sudo kill -HUP `cat /var/run/AppleFileServer.pid`

[ Reply to This | # ]
Easy AFP Reset
Authored by: sbbeachvball on Fri, Sep 30 2005 at 4:33PM PDT
A HUP signal seemed to work for me. So this one liner should work.
Running the grep in the backticks often finds itself, so the grep -v grep
excludes it from the results...

kill -HUP `ps x | grep AppleFileServer | grep -v grep | awk '{print $1}'`

---
Aaron Martin
CNT Crustal Studies, UCSB

[ Reply to This | # ]
Easy AFP Reset
Authored by: sbbeachvball on Fri, Sep 30 2005 at 4:38PM PDT
Ooops, didn't notice the first reply.
Didn't know about the pid file for AppleFileServer, definitely better to use that....

---
Aaron Martin
CNT Crustal Studies, UCSB

[ Reply to This | # ]
Great, but not complete
Authored by: badrad on Wed, Jul 24 2002 at 4:44PM PDT
This works good, but not totally like OS9. While the entire volume is readable, it is not writeable. Plus, if I set a directory to writeable, it does not set subdirectories.

I would like it so any subdirectories/files inherit the privlidges, plus any new files/directories created after the setting of the privledges inherit them. Just like OS 9. Am I making since?

[ Reply to This | # ]
Silly me
Authored by: badrad on Wed, Jul 24 2002 at 4:49PM PDT
Actually you can click apply and the privledges apply to all enclosed folders, BUT, any newly created folders dont automatically inherit the privlidges. That is the last thing I need to figure out.

[ Reply to This | # ]
I was thinking.
Authored by: badrad on Wed, Jul 24 2002 at 4:55PM PDT
I was thinking about it.

The problem is that when a new folder is created, it automatically sets only the owner to have write privledges. If there was a way to change that so either
A. you could customize what the default privlidges are
B. it checks and copies the privlidges of its containing folder.

[ Reply to This | # ]
I figured it all out
Authored by: badrad on Mon, Jul 29 2002 at 5:54PM PDT
read here:

www.abacusgraphics.com/osx/

[ Reply to This | # ]
and then
Authored by: badrad on Wed, Jul 24 2002 at 4:59PM PDT
Some folders OS X doesnt let me change privlidges in at all.

[ Reply to This | # ]
Does
Authored by: Sherman Gregory on Tue, Oct 1 2002 at 12:05PM PDT
I have two machines that had shared public folders outside of any home directory that I set up using the NetInfo Manager method. It seems that since upgrading to Jaguar, they are no longer shared.

Has anyone else noticed this? Anyone know how to make it work?

[ Reply to This | # ]
Does
Authored by: ssevenup on Wed, Nov 27 2002 at 3:56PM PST
Do you have "/users/username/sharedDir" = "Public" in Netinfo? Mine was missing, and it didn't work for me either.

[ Reply to This | # ]
Does
Authored by: dudelsack1 on Wed, Jan 15 2003 at 4:26PM PST
Download the Donation-ware utility SharePoints
http://www.hornware.com/sharepoints
This will solve the problem.

[ Reply to This | # ]
Sharing in 10.2: Jaguar
Authored by: apw8 on Mon, Apr 7 2003 at 9:23PM PDT

I had attempted to share a folder in Jaguar using the steps listed above, but I just couldn't get it to work. Under Jaguar, you need to have all of the following properties to each new SharePoint:

  • name -NetInfo name
  • directory_path -Path to directory
  • afp_use_parent_owner -Boolean: Use owner of parent?
  • afp_use_parent_privs -Boolean: Use privileges of parent?
  • afp_shared -Boolean: Share this item?
  • afp_name -Name visble to clients

name is only used in NetInfo, while afp_name will be used to identify the directory to the client. directory_path should start with a slash (/) so that it is not a relative path. Both afp_use_parent_owner and afp_use_parent_privs should be set to 0 (zero). Finally, make sure that afp_shared is set to 1 (one) so that it will share the directory.



[ Reply to This | # ]
Sharing in 10.2: Jaguar
Authored by: methodshop on Fri, Jun 20 2003 at 6:38PM PDT
It's very easy to share a folder or hard drive connected to an osx server. but not non-connected machines on the network. I want to share a hard drive on a client computer running off an osx server network. When i open the NetInfo Manager and select "config" on that client computer, my only option is "AppleFileServer". how can i share these files?

[ Reply to This | # ]
Sharing in 10.2: Jaguar
Authored by: bussdriver on Fri, Aug 1 2003 at 8:48PM PDT
Just simpy create the SharePoints directory that is now missing by default in 10.2.

The directions work along with the parent post, but now you've got to also add the directory for the sharepoints.

---
ttfn,


[ Reply to This | # ]
Share any folder or volume via Filesharing!
Authored by: awkohr on Fri, Oct 3 2003 at 9:04AM PDT
At least in 10.2 and maybee earlier i don't know if the directory_path field contains a space in the path it doesn't share. It doesn't seem to matter if you use either /My Dir/subdir or /My\ Dir/subdir it will not show up in the share list. I changed the name of the directory to componsate for this although,I didn't try /My%20Dir/subdir as i didn't think of it until afterwards so that may work.

Spaces are acceptable in the both the afp_name and name entries as just plain spaces.

[ Reply to This | # ]
Share any folder or volume via Filesharing!
Authored by: solak on Tue, Nov 9 2004 at 11:21PM PST
Another workaround is to make a symolic link to the directory.

cd /Volumes/Macintosh HD
ln -s name\ with\ spaces _afp_name_wo_spaces

and then for the directory_path use
/Volumes/Macintosh HD/_afp_name_wo_spaces

I note that the volume name is not space-sensitive.
I also was pragmatic about it, and once it worked, I stopped experimenting, so I did not try the %20 substitution. Perhaps some other time.

---

:Solak.


[ Reply to This | # ]
Share any folder or volume via Filesharing!
Authored by: trevorbsmith on Sun, Nov 27 2005 at 11:44AM PST
If anyone stumbles on this tip, do a quick search here (or on Google) for Sharepoints. It's an application/preference panel applet that accomplishes the same thing with less effort.

[ Reply to This | # ]
Time Machine?
Authored by: nomad00 on Thu, Oct 25 2007 at 9:35AM PDT
Just curious if this is how we'd want to be sharing externals for use as newtorked Time Machine drives.

Anyone know?

[ Reply to This | # ]