home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!mnl
- From: mnl@dtro.e-technik.th-darmstadt.de (Michael N. Lipp)
- Subject: How can I invalidate a block device buffer?
- Sender: news@news.th-darmstadt.de (The News System)
- Message-ID: <MNL.92Dec31210305@mnlsun.dtro.e-technik.th-darmstadt.de>
- Date: Thu, 31 Dec 1992 21:03:05 GMT
- Nntp-Posting-Host: mnlsun.dtro.e-technik.th-darmstadt.de
- Organization: TH-Darmstadt
- Lines: 34
-
- I'm using Linux .99p1. Its really great. Yet, I have a problem.
-
- I have written a program `mfcp' that can copy files larger than a
- single floppy on several floppies, breaking it up in chunks of (floppy
- size - 1 sec). (The one sector is used for a header, counting the
- floppies, etc.) I have used this program without problems for the last
- years on a Sun and with Interactive Unix, using the raw floppy device.
-
- There is no raw floppy device in Linux (right?, I didn't find any).
- So I changed the program to handle a floppy device opened as block
- device. There remains one problem: In order to verify that the floppy
- was written correctly, my program re-reads it. It seems that Linux
- keeps the floppy contents buffered although the floppy device has been
- closed after the write and reopened for the verify pass (the floppy
- LED blinks once when the device is reopened, but all subsequent reads
- are satisfied from some buffer). Of course, this is "legal" if a
- change of floppy is detected and the buffer invalidated in that case
- (which, I think is done by Linux). In my program, however, it should
- not be necessary that the user ejects the floppy after the write and
- re-inserts it for the verify.
-
- Is there any way to invalidate the buffer? I would prefer that to
- writing the raw device driver :-).
-
- Michael
-
-
- --
- -----------------,------------------------------,------------------------------
- Michael N. Lipp ! Institut fuer Datentechnik ! Phone: 49-6151-163776
- ! Merckstr. 25 ,----------' Fax: 49-6151-164976
- ! D-6100 Darmstadt ! E-Mail:
- ! (Germany) ! mnl@dtro.e-technik.th-darmstadt.de
- -----------------'-------------------'-----------------------------------------
-