On Sun, Jun 27, 2010 at 10:11 PM, <johnlob...@ovi.com> wrote: > I want to list the shared local folders only if smb file sharing is enabled. > Currently I am scanning the smb port to get this information. Also Ps command > works to check if smb server is running. But the problem is that if, "File > sharing" is disabled and only "printer sharing" is enabled in system > preference then also smb port scan or ps command passes. But in this case > local shared folders should not be listed.
Even though you haven't answered why you want to display the list of local shared folders, I will assume you have a good purpose. smbclient has an -L flag which can be used to enumerate shares on a machine. It does not, as far as I can tell, require authentication. I believe resource enumeration uses a SID reserved specifically for browsing purposes. So you should not need to check to see if the smb service is running on the local machine. (And even if you wanted to do that, invoking `ps` is about the wrongest way you can do it.) Just browse the local machine, and use that to populate your list of shares. No matter what you do, you will need to authenticate to actually mount the share. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com