Path: utzoo!attcan!uunet!midway!linac!uwm.edu!cs.utexas.edu!rutgers!mephisto!mcnc!uvaarpa!mmdf From: telxon!ping!gorpong@uunet.uu.net Newsgroups: comp.lang.perl Subject: PERL PL28 and reading raw devices (problem) Message-ID: <1990Sep26.122859.18935@uvaarpa.Virginia.EDU> Date: 26 Sep 90 12:28:59 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: telxon!ping!gorpong@uunet.uu.net Organization: The Internet Lines: 35 I am writing a perl program which will handle tape copying from remote or local devices. The scheme I use for a local source device is to open up the device via: open(SRC_TAPE, "< $SRC_TAPE"); I then open up a pipe to write the remote tape (or pipe to read the remote). When going remote for the device, I use the 'dd' command to do the reading and/or writing. Enough background, now to the question. When copying a tape which is in boot format, the program tells me that it has read and written the exact same number of bytes. When attempting to boot this tape, it fails every time, on every tape drive. When forcing the program to use 'dd' to read the tape and write the tape, it also tells me that the correct number of bytes have been written. However, the copy made with 'dd' on both ends boots correctly. I am reading the tape with the perl read(SRC_TAPE, $_, $blksize); and SRC_TAPE is opened either "< device" or "dd if=device |" The exact same code works when the open is opening up a 'dd' command to read the device. Is there something which perl is doing to the bytes read in from the raw device which it does not do when reading from a pipe? I should note that when copying things like 'tar' format tapes, it is still in tar format, and it unarchives correctly. It really screws up boot format tapes. My question is, why? It is perl patchlevel 28 on a Sun 3/50 or 3/anything (or 4/anything) running SunOS 4.1. Any help you may be able to give me would be greatly appreciated. -- Gordon. -- Gordon C. Galligher 9127 Potter Rd. #2E Des. Plaines, Ill. 60016-4881 telxon!ping%gorpong@uunet.uu.net (not tested) (Is this even legal??) ...!uunet!telxon!ping!gorpong (tested) (And it works!) "It seems to me, Golan, that the advance of civilization is nothing but an exercise in the limiting of privacy." - Janov Pelorat -- _Foundation's Edge_