Re: searching through all user accounts
Re: searching through all user accounts
- Subject: Re: searching through all user accounts
- From: Marcus Karlsson <email@hidden>
- Date: Sun, 29 Jul 2012 13:25:41 +0200
On Sun, Jul 29, 2012 at 06:23:14PM +0800, Rick C. wrote:
> Hi,
>
> I have a search app which normally searches through the current users home directory using NSTask and find command. If I wanted to make it search through all user accounts could I ask some advice on what is the best way to make it work? Because I know permissions will be an issue. Thanks,
>
> rc
You can iterate through all users using getpwent() and run one task per
user. Find will just ignore any directories and files which it doesn't
have permission to read. If you want to go around that then you will
have to for example elevate to a user that have the appropriate access
rights or add ACL's that allows you to read.
Marcus
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden