root@chief.UUCP (Lance Ellinghouse) (12/21/88)
Does anyone know how the people at SCO lock their mail files when they are scanned in by mail? I would like to write a similar one that does not have the shell escape and I cannot figure out what they use as a lock. DO they actually lock it, or do they use a temp file? Thanks, Lance Ellinghouse -- Lance Ellinghouse Chief Numismatics, Inc UUCP: ...!{hermix|srhqla|ucla-an|alphacm}!chief!lance ARPA: ucla-an!hermix!chief!lance@ee.UCLA.EDU
dheller@cory.Berkeley.EDU (Dan Heller) (12/23/88)
In article <462@chief.UUCP> root@chief.UUCP (Lance Ellinghouse) writes: > Does anyone know how the people at SCO lock their mail files > when they are scanned in by mail? I would like to write a similar > one that does not have the shell escape and I cannot figure out > what they use as a lock. DO they actually lock it, or do they use > a temp file? > > Lance Ellinghouse > Chief Numismatics, Inc > UUCP: ...!{hermix|srhqla|ucla-an|alphacm}!chief!lance > ARPA: ucla-an!hermix!chief!lance@ee.UCLA.EDU SCO's xenix, unfortunately, uses a file locking mechanism which is not available to the end user. Execmail use a temp lock file called /tmp/.mlkXXXXX to lock the file, but other things are done as well, so just creating the file won't do. The routine to lock the file is not in a library; it's part of the source to execmail. Probably someone at sco should elaborate on this, but the bottom line is that writing your own mail user agent is tricky. The best you can do is to use lockf(). Dan Heller <island!argv@sun.com>