netinfo

WeeZer51402

Registered
does anybody know the function calls to create/append/delete properties and directories in the netinfo database?
 
Are you talking about in the terminal? If so, then the command for that is niutil. Also related are nidump (which will print out the stuff in the NetInfo domain), niload (you can use it to load properties from a file), nifind (can use it to find instances of a property), and nigrep (can use it to search with regular expressions).

I have to say though, it's a lot easier to use the NetInfo application in /Applications/Utilities to mess with all of that than using the command line programs.
 
Ah, that makes a little more sense.

man netinfo

...

#include <netinfo/ni.h>

...however, I don't know which library you need to link against for it. It seems that all of these libraries have something of it, yet I'm not sure which specific one you need to link against:

/usr/lib/libc.dylib
/usr/lib/libinfo.dylib (most likely one, to me)
/usr/lib/libkvm.dylib
/usr/lib/libm.dylib
/usr/lib/libpthread.dylib
/usr/lib/libSystem.B.dylib
/usr/lib/libSystem.B_debug.dylib
/usr/lib/libSystem.B_profile.dylib

(I got those by grepping through /usr/lib, with searches of the different functions declared in the netinfo includes...all of those kept popping up as matches.)
 
ok i found somemore info at apples developer site but what i want this program to do is to create afp share points which needs to be done through netinfo but i need someone that knows about the netinfo c functions so i dont trash my system(ill probably set up a system to just do this with and save a backup copy of the netinfo database on the cd so i can just restore it if i do trash it) but if anyone has used <netinfo/ni.h> before please give me a heads up about what im getting into.
 
I haven't ever used the netinfo stuff, but it doesn't seem too bad. The header file & the man page together seem pretty good at stepping through what is needed.

One thing I do know, you'll have to be root or use sudo (or if you're making a Cocoa program, use the Security framework) to be able to change anything in the netinfo domain.
 
Back
Top