From owner-freebsd-questions Mon Sep 1 23:18:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA18145 for questions-outgoing; Mon, 1 Sep 1997 23:18:52 -0700 (PDT) Received: from gdi.uoregon.edu (cisco-ts15-line15.uoregon.edu [128.223.150.198]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA18137 for ; Mon, 1 Sep 1997 23:18:48 -0700 (PDT) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.5/8.8.5) with SMTP id XAA03222; Mon, 1 Sep 1997 23:18:37 -0700 (PDT) Date: Mon, 1 Sep 1997 23:18:36 -0700 (PDT) From: Doug White X-Sender: dwhite@localhost Reply-To: Doug White To: Zach Heilig cc: questions@freebsd.org Subject: Re: Is that floppy write-protected? In-Reply-To: <19970831105416.59270@gaffaneys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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