Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!hp4nl!ctisbv!pim From: pim@cti-software.nl (Pim Zandbergen) Newsgroups: comp.unix.i386 Subject: Re: Backup utilities for ix-386 Keywords: backup ix-386 Message-ID: <1605@ctisbv.cti-software.nl> Date: 24 Oct 89 14:37:34 GMT References: <107@gizzmo.UUCP> <185@softest.UUCP> <[253554b6:333.1]comp.unix.i386;1@vpnet.UUCP> <11954@watcgl.waterloo.edu> <3741@dell.dell.com> <329@rsiatl.UUCP> Organization: CTI Software BV, The Hague, the Netherlands Lines: 49 jgd@rsiatl.UUCP (John G. De Armond) writes: >The second thing is that it will properly handle end-of-tape. In interactive, >the cpio "handles" end-of-tape (apparently) by keying on the special device >name given and counting bytes. The problem arises when you use a DC-300 >tape in a DC-600 drive. Cpio merrily runs off the end of the tape. In all Unix System V implementations I know, the device driver fails to do the last write(2) and sets errno to ENXIO (no such device or address). cpio catches this error and will ask for the next medium. afio won't, but it was quite easy to fix afio to recognize ENXIO. This way, you can use afio with any raw device, without having to know its capacity. Here's the patch. *** afio.c.old Tue Jul 5 21:25:06 1988 --- afio.c Thu Aug 25 15:03:51 1988 *************** *** 2164,2172 **** ? syserr() : "Apparently full"); _exit(1); ! } else if (got < 0) ! fatal(arspec, syserr()); ! else next(O_WRONLY, "Apparently full"); } } --- 2164,2175 ---- ? syserr() : "Apparently full"); _exit(1); ! } else if (got < 0) { ! if (errno = ENXIO) ! next(O_WRONLY, "End of medium"); ! else ! fatal(arspec, syserr()); ! } else next(O_WRONLY, "Apparently full"); } } -- Pim Zandbergen internet : pim@cti-software.nl CTI Software BV uucp : ..!uunet!ctisbv!pim Laan Copes van Cattenburch 70 phone : +31 70 542302 2585 GD The Hague, The Netherlands fax : +31 70 512837