🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Henry Spencer Fri, 30 Mar 1984 22:13
SysN test != V7 test
#191
Author: Henry Spencer
Date: Fri, 30 Mar 1984 22:13
30 lines
2160 bytes
One of the more interesting things done in System N (N = III or V just
now) was that "test" is built into the shell.  Although we don't run
System V, we do run a slightly-modified System V shell on our V7.  We
have just discovered a very interesting thing:  the test(1) command
that is built into the shell is not quite the same as the old separate
program.

The difference is that the old test(1) tested for accessability by
trying to open the file.  The in-shell one just uses access(2) to look
at the permission bits.  What difference is there, you ask?  Well...
There's a minor difference in the case of "test -w directory".  This
isn't too important, and the new behavior (actually look at the bits
rather than just bouncing it regardless) is arguably better.  The *real*
fun is when you are doing a test(1) on a device.

We discovered this because we had a few things that used to do, for
example, "test -r /dev/rmt0" to make the magtape rewind.  Don't work
no more.  This breaks things.  Not very many things, mind you, and we
don't see this as too serious issue.  However, consider the following.
Shell file, written on System V, does "test -w /dev/rmt0" to see if
it's running on a system with a magtape at a suitable name.  On a system
with the old-style test(1) command, this will write a tape mark at the
beginning of the tape, effectively obliterating any data on the tape!

Another fun property of using access(2) for test(1) is that access(2)
uses the real, not effective, userid.  This could make setuid shell
files (if you have them -- we don't) *very* interesting.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry
Re: SysN test != V7 test
#193
Author: Dave Martindale
Date: Sat, 31 Mar 1984 19:17
9 lines
1046 bytes
Re: test -w /dev/rmt0 writes a tape mark on tape in v7

Interesting.  You can probably still read much of the data on the tape
by skipping over the tape mark.  However, if the tape was originally
written at one density, and the tape mark gets written at a different
density, you won't be able to read anything at all, since drives which
handle multiple recording densities usually look at an identification
burst (or lack of it) at the beginning of the tape to determine the density
of the rest of the tape.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads