Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 7212
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors: Paul.Marquess [...] btinternet.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.10
Fixed in: (no value)



Subject: Problem extracting empty files
Consider the code at the end of the message -- all it does is create a tar file with a number of files in it. It then uses Archive::Tar to list its contents. The important point is that one of the files, "fred/c", in the tar is empty. The behaviour I'm seeing is that Archive::Tar seems to think that the empty file is the last thing in the archive. Here is what I get when I run the script. I assume this isn't expected behaviour? Archive::Tar version 1.10 Archive contains 4 files fred/ fred/a fred/b fred/c drwxr-xr-x pmarques/wap 0 2004-07-22 15:00:21 fred/ -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/a -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/b -rw-r--r-- pmarques/wap 0 2004-07-22 15:10:31 fred/c -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/d -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/e Cheers Paul use Archive::Tar ; use strict; use warnings; print "Archive::Tar version $Archive::Tar::VERSION\n" ; my $archive = 'fred.tar'; my $dir = 'fred'; mkdir $dir ; system "echo hello >$dir/a" ; system "echo hello >$dir/b" ; system "touch $dir/c" ; system "echo hello >$dir/d" ; system "echo hello >$dir/e" ; system "tar cf $archive $dir" ; my $tar = Archive::Tar->new; my $count = $tar->read($archive); print "Archive contains $count files\n"; my @list = $tar->list_files(); print "\t$_\n" foreach @list ; print "\n"; system "tar tvf $archive" ; $ perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.21-1.1931.2.393.entsmp, archname=i386-linux-thread-multi uname='linux por' config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef' useithreads=define usemultiplicity= useperlio= d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=un uselongdouble= usemymalloc=, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-19)', gccosandvers='' gccversion='3.2.3 200305' intsize=o, longsize=s, ptrsize=l, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long' k', ivsize=4' ivtype, nvtype='double' o_no', nvsize=, Off_t='', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc' l', ldflags =' -L/usr/local/lib' ldflags_use' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil perllibs= libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libper gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE' cccdlflags='-fPIC' ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s Unicode/Normalize XS/A' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Locally applied patches: MAINT18379 Built under linux Compiled at Sep 15 2003 10:03:52 %ENV: PERL5LIB="/workspace3/tmp/marquess/tmp-install/lib/perl5/5.8.0/:/workspace3/tmp/marquess/tmp-install/lib/perl5/site_perl/:/mine/perl/lib/site_perl:/mine/perl/lib/:/users/pmarques/perl5lib" @INC: /workspace3/tmp/marquess/tmp-install/lib/perl5/5.8.0//i386-linux-thread-multi /workspace3/tmp/marquess/tmp-install/lib/perl5/5.8.0/ /workspace3/tmp/marquess/tmp-install/lib/perl5/site_perl//5.8.0/i386-linux-thread-multi /workspace3/tmp/marquess/tmp-install/lib/perl5/site_perl//5.8.0 /workspace3/tmp/marquess/tmp-install/lib/perl5/site_perl/ /mine/perl/lib/site_perl /mine/perl/lib/ /users/pmarques/perl5lib /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .
[guest - Mon Aug 2 10:25:13 2004]: Show quoted text
> Consider the code at the end of the message -- all it does is create a > tar file with a number of files in it. It then uses Archive::Tar to > list its contents. The important point is that one of the files, > "fred/c", in the tar is empty. The behaviour I'm seeing is that > Archive::Tar seems to think that the empty file is the last thing > in the archive. > > Here is what I get when I run the script. I assume this isn't expected > behaviour? > > Archive::Tar version 1.10 > Archive contains 4 files > fred/ > fred/a > fred/b > fred/c > > drwxr-xr-x pmarques/wap 0 2004-07-22 15:00:21 fred/ > -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/a > -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/b > -rw-r--r-- pmarques/wap 0 2004-07-22 15:10:31 fred/c > -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/d > -rw-r--r-- pmarques/wap 6 2004-07-22 15:10:31 fred/e
and the plot thickens.. this is what i get on my machine: [kane@myriad ~...tmp/empty-file-bug]$ perlc x.pl Archive::Tar version 1.10 Archive contains 6 files fred/ fred/a fred/b fred/c fred/d fred/e drwxr-xr-x kane/staff 0 2004-08-13 14:51:52 fred/ -rw-r--r-- kane/staff 6 2004-08-13 14:52:19 fred/a -rw-r--r-- kane/staff 6 2004-08-13 14:52:19 fred/b -rw-r--r-- kane/staff 0 2004-08-13 14:52:19 fred/c -rw-r--r-- kane/staff 6 2004-08-13 14:52:19 fred/d -rw-r--r-- kane/staff 6 2004-08-13 14:52:19 fred/e so it must be the way your tar binary writes away the files that is different from mine, and causing some error... could you mail me your fred.tar, and give me the tar -v of your tar binary? thanks.
From: pmqs [...] cpan.org
Was about to direct you to my retraction in 7209, when I spotted your update to 7209. sorry for the confusion. Paul ps I didn't get your responses to my tickets via email. Had to log onto rt. Not sure if there is a problem with RT or my spam filter is over zealous.