Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 1997 23:18:36 -0700 (PDT)
From:      Doug White <dwhite@gdi.uoregon.edu>
To:        Zach Heilig <zach@gaffaneys.com>
Cc:        questions@freebsd.org
Subject:   Re: Is that floppy write-protected?
Message-ID:  <Pine.BSF.3.96.970901231541.3114P-100000@localhost>
In-Reply-To: <19970831105416.59270@gaffaneys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 31 Aug 1997, Zach Heilig wrote:

> > Check the return value from `rm'; if it's >0 then something bad happened.
> 
> see apended log [1]...
> 
> > > I know I could unmount the floppy, remount it, and test if the files are
> > > really gone, but then /var/log/messages becomes full of needless
> > > write-protected floppy errors.  This is what I ended up doing, but it
> > > would be nice if there were a better solution.
> 
> > How about re-read the directory following the `rm'?  If rm trashed the
> > file then the dir re-read should show it's gone.
> 
> The file is gone, from the operating systems point of view.  It just can't
> tell the floppy that.  It would probably be good if mount(1) would autodetect
> read-only media, and mount it read-only. :-).  Unfortunately, there are many
> types of media...

Hm.  I suppose it wouldn't be too difficult to teach mount how to check
for write-protectedness (I assume there is an ioctl() to do it, or
implementing a standard ioctl() on all devices to check it shouldn't be
that hard, this coming from a non-kernel hacker).  

You might consider asking hackers@freebsd.org about it.  They may be able
to add any suggestions.

Doug White                              | University of Oregon  
Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
http://gladstone.uoregon.edu/~dwhite    | Computer Science Major
Spam routed to /dev/null by Procmail    | Death to Cyberpromo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.970901231541.3114P-100000>