Re: Xitami.EuCGI

new topic     » goto parent     » topic index » view thread      » older message » newer message

At 10:14 AM 05-03-1999 , you wrote:
>>The first Euphoria guestbook CGI system (just 2 CGIs in fact) is done and
>>available from:
>
>I downloaded Xitami and installed it on my 2nd computer, so I can learn how
>to do CGI stuff, too. :) In the docs, its seems that .BAT files are
>supported, too, but I haven't tested yet. (I used the #! exw file style
>thing :)

I've read that .BAT files may be unsecure (don't know why). One good thing
about 32-bit CGIs opposed to 16-bit (and .bat I presume) is that the
webserver can kill the process after a given timeout.

>Quick question about databases (like guestbooks) done in CGI:
>
>How would you keep two or more users using the same script at the same time
>from trampling all over the datafile as it's being written to? I know that
>usually files are locked in a network envornment, but how would this be done
>in Euphoria?

Key question. I haven't implemented no locking funcitonality on my EuCGIs
yet (BTW I'm downloaded the ADO/ODBC SDK and looking how to implement it on
Euphoria). I don't expect to have yet concurrent users (no one has signed
my guestbook yet).

A way to do it might be have a flag file or registry entry that tell the
file is under update. The CGI should wait for until a given timeout to see
if the flag is cleared.

This shouldn't be done by the write_to_dabatase CGI... it may crash and
leave the file eternally locked, but by a DBMS. You can create your own
EuDBMS that run's on systenm startup and recieves requests to read/write to
the database. The ideal interprocess comunication would be DDE, but it's a
bit complicated a first. A simpler solution would be a SendMessage() with
the message being the operation to perform, wParam as an LPSTRZ to the
database filename and lParam holding other requiered parameters (record
number?). Or even better, use shared memory (mmmm... looks like DDE ;) ).


>(Now, let's see... I'm only trying to complete 5 or 6 totally unreleated
>projects at this time...)

Good. I always do the same ;) Someday I'll finish them all.


Regards,
         Daniel  Berstein
         [daber at pair.com]

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu