Array Sizes (was Re: List of User Accounts)
Array Sizes (was Re: List of User Accounts)
- Subject: Array Sizes (was Re: List of User Accounts)
- From: Robin Perkins <email@hidden>
- Date: Sat, 27 Mar 2004 21:49:46 +1030
You should many as few assumptions about what your users are going to
do with your software as possible.
Working out the size of an array is a common problem in programming,
you should avoid making it a certain size and hope users don't fill it
- or - making it huge and thus waste memory and resources on somethings
that isn't used. One such solution is to create a new array slightly
bigger than the previous one and copy the data from the original array
into the new one you created (then destroy the old one). Knowing how
much bigger is situation dependant and comes with a bit of practice -
you don't want to have to create a new array too often, nor do you want
to waste resources as I described before.
On 27/03/2004, at 4:08 PM, Matt Jaffa wrote:
Nevermind I got it to work,
I just increased the size of the data buffer and it didn't freeze
anymore in the loop.
So Is it smart to make that buffer extremely bug, in case a customer
has many
accounts on their computers that are managed?
It seems managed accounts have more data about a user to be extracted.
Matt
Begin forwarded message:
From: Matt Jaffa <email@hidden>
Date: March 26, 2004 10:32:19 PM MST
To: Gwynne <email@hidden>
Cc: Jason Townsend <email@hidden>, Cocoa-Dev List
<email@hidden>
Subject: Re: List of User Accounts
This code works Great,
except if I go to accounts and change the users Limitations to
Managed, instead of standard,
it freezes and goes into an infinite loop.
On Mar 23, 2004, at 7:21 PM, Gwynne wrote:
On Mar 23, 2004, at 8:56 PM, Matt Jaffa wrote:
yeah, could you send me off list the sample code,
Gladly :). It's attached to this message. It's a simple UNIX tool
that will printf all the users on the system, whether they're system
or real users, and their user IDs. This is probably slightly more
than you need, but it's easy to cut out the stuff you don't. Note
that this code does NOT do error checking, because that makes DS code
about four times longer. I'm assuming you're intelligent enough to
check for error/NULL returns from the functions :). Also note, a
significant portion of this code is ripped from the DS documentation.
<dslst> <dslst.c>
On Mar 23, 2004, at 6:49 PM, Gwynne wrote:
Ask for the kDS1AttrGeneratedUID attribute and discard anything
that doesn't have it. You'll need to filter out "root", though,
since for some reason it gets it too. I can send you some sample
code off-list if you need it.
-- Gwynne, key to the Code that runs us all
Formerly known as Sailor Quasar.
Email: email@hidden
Web: http://musicimage.plasticchicken.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.