[comp.unix.xenix] Xenix Help ? MapChan : Shell Layers : Backup : File Locking

ashley@cheops.eecs.unsw.oz (Ashley M. Aitken) (06/05/89)

G'Day,

I have a couple of questions/problems  relating  to  the  use  of
xenix, if anyone could help me find solutions I would be most ap-
preciative.  The xenix system I am working on is version 2.3.1 on
a compaq 386 with a stallion (brumby = 4 port) serial board.

Mapping Keys:

I would like to map some keys on a Freedom Liberty (Wyse 50) key-
board  (the  keys  around  the  numeric  pad) to some other ascii
values (ie + * ...). What is the simplest way to do  this?  There
are  2 terminals I wish to do this for, the other and the console
I do not. I looked briefly at mapchan, but got lost,  is  it  the
answer?

Shell Layers:

When I try an run shell layers on anything but the console I  get
an error (the number and message at the moment eludes me, perhaps
error number 25: unable to ???). Is  it  possible  to  run  shell
layers  on  other than the console, and if so why are my attempts
failing? Do I need to reconfigure the system?

Backup:

Does the backup work on a daily schedule or on  the  sequence  of
backups, that is, if I was supposed to back up on Friday, but ran
backup on Thursday, it would tell me, no backup for  today.  This
is  what  I  have encountered, and I would like to know how I can
alter the day (for example, if I did wish to do  the  backups  on
Thursday  now-on). What happened was I started by backup schedule
on the wrong day, and now the schedule seems to be out of  synch.
It  won't let me do the backup I wish to do on Friday until it is
Sunday. How can I resynchronize the backup sequenc? Should I just
postpone  a  Sunday Backup till the next Friday? Can I change the
recorded epoch date?

Also is it possible to use two different media for backup, ie the
cartridge tapes for full dumps and floppies for incremental back-
ups?

File "Locking":

I would like to lock a file while someone is editing it, that is,
if  someone edits a file then it is not possible for someone else
to edit (ie attempt to change) that file. The  point  being  that
only one of the edits could survive. Normal file locking does not
seem to be valid in this case (perhaps I am  missing  something),
because  the  editor  take  a  copy of the file and then works on
that. At present I have created an  edit  command  shell  script,
that  copies  the  file into another file and edits that file (if
that file does not exist) otherwise it just opens  the  file  for
reading only. Is this the easiest way to do this?

If anyone has any ideas or suggestions on the above  I  would  be
most  grateful if you could please e-mail me at the address given
below.

Thanks in Advance,

Ashley Aitken.


E-MAIL  ashley@cheops.unsw.oz					   ACSnet
	ashley%cheops.unsw.oz@uunet.uu.net			   ARPAnet
	ashley@cheops.unsw.oz.au				   ARPAnet
	{uunet,ukc,ubc-vision,mcvax}!munnari!cheops.unsw.oz!ashley UUCP	
	ashley%cheops.unsw.oz@australia				   CSnet
	ashley%cheops.unsw.oz@uk.ac.ukc				   JAnet

POSTAL	Academic Address:			Residential Address:
	Computer Science Department, EECS,	c/o Basser College,
	University of New South Wales,		The Kensington Colleges,
	Box 1,PO KENSINGTON,N.S.W.,2033,	Box 24,PO KENSINGTON,3033.
	AUSTRALIA.				AUSTRALIA.
	Ph. (02) 697-4055 Fx. (02) 662-2087	Ph. Aust (02) 663-8117

dold@mitisft.Convergent.COM (Clarence Dold) (06/08/89)

in article <1169@cheops.eecs.unsw.oz>, ashley@cheops.eecs.unsw.oz (Ashley M. Aitken) says:
> File "Locking":
> 
> I would like to lock a file while someone is editing it, that is,
> if  someone edits a file then it is not possible for someone else
> to edit (ie attempt to change) that file. The  point  being  that
> only one of the edits could survive. Normal file locking does not

There are two types of lock possible, one is 'advisory', the other is
'mandatory'.  Historically, most file locks have been advisory, where a 
program checks to see if a mutually agreeable lock exists, before it 
proceeds.  Vi doesn't check, and isn't bound by advisory locks.
Mandatory locking would prevent vi from modifying a file that was opened
with a lock, but vi itself doesn't ask for such a lock.


With advisory locking, you can't prevent others from trashing your 
edit session, unless you all agree to use the same 'wrapper' for the 
editing.
With mandatory locking, you can prevent others from trashing your edit
session, but it requires that you invoke a non-standard wrapper around vi.

A wrapper in this sense would open the target with a lock, then invoke
the editor of choice via exec.  If you have an exclusive lock, and a mandatory
locking file system, then someone else starting a vi would pause,
waiting for the lock to be released.
-- 
---
Clarence A Dold - dold@tsmiti.Convergent.COM		(408) 434-5293
		...pyramid!ctnews!tsmiti!dold
		P.O.Box 6685, San Jose, CA 95150-6685	MS#10-007

morrison@ficc.uu.net (Brad Morrison) (06/08/89)

In article <724@mitisft.Convergent.COM>, dold@mitisft.Convergent.COM (Clarence Dold) writes:
> in article <1169@cheops.eecs.unsw.oz>, ashley@cheops.eecs.unsw.oz (Ashley M. Aitken) says:
> > File "Locking":
> > 
> > I would like to lock a file while someone is editing it . . .

> A wrapper in this sense would open the target with a lock, then invoke
> the editor of choice via exec.  If you have an exclusive lock, and a mandatory
> locking file system, then someone else starting a vi would pause,
> waiting for the lock to be released.

Unless you try to lock without blocking; you can return immediately and
check errno for the EACCESS error.
-- 
    Grep me no patterns and     | Brad Morrison             (713) 274-5449
    I'll tell you no lines.     | uunet!ficc!morrison morrison@ficc.uu.net

jhoward@helps.cactus.org (James Howard) (06/09/89)

in article <1169@cheops.eecs.unsw.oz>, ashley@cheops.eecs.unsw.oz (Ashley M. Aitken) says:
>...
> File "Locking":
> 
> I would like to lock a file while someone is editing it, that is,
> if  someone edits a file then it is not possible for someone else
> to edit (ie attempt to change) that file. The  point  being  that
> only one of the edits could survive. Normal file locking does not
>...

Wouldn't sccs be the best way to do this?

  ------

James Howard AA5R     Howard Electronic Laboratories Products & Services
                      jhoward@helps.cactus.org  or  bigtex!helps!jhoward