Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 3.33 / 5
  You rated: 5 / 5 (6 votes cast)
 
[122,017 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 whoever posted them. This site is not responsible for what they say.
dev tools required?
Authored by: dreness on Nov 08, '01 08:33:33PM

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 Nov 08, '01 10:18:19PM

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 Nov 08, '01 11:07:10PM

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 Nov 09, '01 12:04:36AM
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 Nov 09, '01 05:40:33PM

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 Nov 14, '01 01:28:37PM

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 Nov 09, '01 05:23:29PM

Without dev tools installed, I have /config/SharePoints/ (10.1).



[ Reply to This | # ]
dev tools required?
Authored by: kerim on Dec 02, '01 09:55:46AM

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 Dec 11, '01 03:32:08PM
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 Nov 27, '02 10:05:20PM
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 Sep 30, '05 04:33:34PM

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 Sep 30, '05 04:38:08PM

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 Jul 24, '02 04:44:02PM

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 Jul 24, '02 04:49:11PM

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 Jul 24, '02 04:55:24PM

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 Jul 29, '02 05:54:25PM

read here:

www.abacusgraphics.com/osx/



[ Reply to This | # ]
and then
Authored by: badrad on Jul 24, '02 04:59:06PM

Some folders OS X doesnt let me change privlidges in at all.



[ Reply to This | # ]
Does
Authored by: Sherman Gregory on Oct 01, '02 12:05:58PM

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 Nov 27, '02 03:56:14PM

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 Jan 15, '03 04:26:43PM

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 Apr 07, '03 09:23:25PM

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 Jun 20, '03 06:38:23PM

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 Aug 01, '03 08:48:03PM

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 Oct 03, '03 09:04:31AM

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 Nov 09, '04 11:21:51PM

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 Nov 27, '05 11:44:32AM

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 Oct 25, '07 09:35:08AM

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 | # ]