Here's the trick...

Say you create 2 characters under your account....
dumb & bumm - for the sake of argument...

say your account name is Jason

So you'd have 2 pfiles:

Baggins.Jason
Jessie.Jason

Now, if you were to try to login under either of those, I need
to make sure Baggins.Jason exists, no biggy there, access() would
work fine...

But say then you tried to login under a name that is not yours, say for
instance: Penthral

So it would look for Penthral.Jason

No biggie there, if that character isn't created, however, if that
happens to be under another name, say the pfile  Penthral.Weirdo
already exists, well, I need to make sure that you dont create
that character...  Hence the reason I'm checking against Penthral.*

So, I guess my real question is, to the best of my knowledge,
access() doesn't allow wildcards, am I mistaken in this?

And to the other repliers, thank you, I've been working on getting
this fixed for a while now, and that's actually the reason I went with this
less-effective ls method, as I could think of no other way to check to see
if a character exists under ANY account...

--
Jamie Harrell               |  [EMAIL PROTECTED]
                                  |  URL: http://icechild.dhs.org
ICQ: 2985611              |  AIM: Liquidicie
--
"A computer scientist is someone who, when told to 'Go to Hell',
            sees the 'go to', rather than the destination, as harmful."
--

*********** REPLY SEPARATOR  ***********

On 2/4/2002 at 3:53 PM Jason Gauthier wrote:

>If you want to just check to see if the file exists use access(), then
>open
>it.
>
>BTW, if you can use execl() instead of system(), less of a performance hit.
>
>> -----Original Message-----
>> From: Jamie Harrell [mailto:[EMAIL PROTECTED]
>> Sent: Monday, February 04, 2002 3:36 PM
>> To: [email protected]
>> Subject: system()
>>
>>
>> Hey all, long time since I've asked anything here, but here goes... ;)
>>
>> I'm performing a character-locking sequence on my mud, where I allow
>> people to have a single account, with all of their characters
>> associated
>> with that.
>>
>> Therefore, I've modified the playerfile format, to allow for locking,
>> the new naming policy is:
>>
>> playername.accountname
>>
>> These are still located within the /player/ folder.
>>
>> Now, more to my question.
>>
>> When someone attempts to sign on, to allow for realtime checking, I
>> am doing a system() call like such:
>>
>> sprintf(buf, "ls %s/%s.* > accountownz", PLAYER_DIR, lookup_name);
>> system(buf);
>>
>> Pretty simple eh?  Alright, now for the fun part.... I can
>> check the file
>> (accountownz) on open for eof, however, in doing so, I lose a single
>> character to the check.....
>> (Which as far as I know in C, is required for an EOF check)
>>
>> So, I guess I'm asking, anyone have any tips for checking a
>> blank file
>> where I wouldn't lose that head character? (as it is
>> essential for strcmp later
>> in the function)
>>
>> Or is there anyway to directly get the output from the system
>> call into a
>> char* or something, where I could then just parse the
>> information within the
>> code itself instead of having to write it to a file?
>>
>> Hope this makes sense, if not, feel free to ask away, I can
>> explain further...
>>
>> Thanks for your time reading,
>> --
>> Jamie Harrell               |  [EMAIL PROTECTED]
>>                                   |  URL: http://icechild.dhs.org
>> ICQ: 2985611              |  AIM: Liquidicie
>> --
>> "A computer scientist is someone who, when told to 'Go to Hell',
>>             sees the 'go to', rather than the destination, as
>> harmful."
>> --
>>
>>
>> --
>> ROM mailing list
>> [email protected]
>> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>>
>
>--
>ROM mailing list
>[email protected]
>http://www.rom.org/cgi-bin/mailman/listinfo/rom




Reply via email to