On Thu, 5 Apr 2001 [EMAIL PROTECTED] wrote:
..
> > i'd like to make a program that logs some output to a text
> > file. i have a few questions here:
> > 
> >    1) do i need to implement a locking mechanism? the
> > program is web-accessible and many users may be accessing
> > it simultaneously. i don't want the log file to get
> > corrupted.
> > 
> 
> Yes, of course.  Or you can make a daemon program that uses SysVIPC
> (or POSIX.1b message queues? are they already supported in Linux?) to
> communicate with client processes, queueing each request that would
> write to the log file.

dats too complex. just write to a pipe, ala unix syslog. if you ensure
that writes are atomic (you can use fcntl to do dat) i/o will be
serialized. if its good enuff for syslog, its good enuff for you  :


-- 

---------------------------------------------------------------------
Orlando Andico <[EMAIL PROTECTED]>       POTS Phone: +63   (2) 848-2893
Mosaic Communications, Inc.            GSM Mobile: +63 (917) 531-5893
I'm not suffering from insanity -- I'm enjoying  every minute of it!!

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to