Subject: Re: Addition to force open to open only regular files
To: None <tech-kern@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 11/15/2000 20:13:23
[ On Sunday, November 12, 2000 at 21:14:16 (+1100), Simon Burge wrote: ]
> Subject: Re: Addition to force open to open only regular files 
>
> It's that act of opening and then closing a file that would, for
> example, cause a tape drive to rewind or eject.  By then it's too
> late - fstat() will only tell you that the tape device you just
> opened will eject when you close the device.

This is a bogus concern.  Any device which suffers this problem is
broken by design and does not fit into the Unix model and should be
fixed.  Open(2) and close(2) should never do "destructive" things of
this sort.  If the device must not be rewound unexpectedly then it
should require an explicit ioctl() to trigger the rewind and should not
support a rewind-on-close.  Tapes in particular should always rewind on
close so as to allow eject/removal/unmount (whether by mechanised or
manual intervention) but they should not eject so that they cannot be
used again without manual intervention.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>