Xref: utzoo comp.compression:544 comp.lang.perl:5267 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!rice!uw-beaver!milton!sumax!polari!thebes!camco!bill From: bill@camco.Celestial.COM (Bill Campbell) Newsgroups: comp.compression,comp.lang.perl Subject: Problems running compress from perl on MS-DOS Summary: Runs out of memory, output garbled Keywords: compress, perl, MS-DOS Message-ID: <991@camco.Celestial.COM> Date: 9 May 91 20:42:03 GMT Followup-To: comp.compression Organization: Celestial Software, Mercer Island, WA Lines: 47 I am trying to build an archive of compressed files on an MS-DOS system using a perl script. The guts are: open(INPUT, "filelist"); # opens input file list open(ARCHIVE, "archive"); binmode(ARCHIVE); $buf_size = 512; while() { chop; system("compress < $_ > tmpfile.Z"); $comp_size = (stat('tmpfile.Z'))[7]; &write_file_header(); # contains, names, sizes... open(WORKFILE, "tmpfile.Z"); binmode(WORKFILE); $\ = ''; # don't insert anything after each write while(sysread(WORKFILE, $buffer, $buf_size) > 0) { print ARCHIVE $buffer; undef($buffer); # strange stuff remaining on short # read if I don't do this. } close(WORKFILE); } close(INPUT);.... This works fine on Xenix/Unix systems, but the MS-DOS version has one of two problems: 1. It frequently says that it is out of memory compressing from stdin. I have recompiled compress for 12-bit compression and it does this less frequently, but it still does it. 2. The compressed file is longer than it should be. It appears that it might be created as a text file rather than binary when the standard output is redirected to the file. I'm using compress,v 4.3d compiled with Xenix cc -dos in large model. I don't know much about MS-DOS (by choice), and don't understand why this should fail in this manner. Compressing in-place works fine under MS-DOS. Does anybody know what I'm doing wrong? Thanks -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software UUCP: ...!thebes!camco!bill 6641 East Mercer Way uunet!camco!bill Mercer Island, WA 98040; (206) 947-5591