bug-cpio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-cpio] how to archive a file with size 0 and mode 0


From: Bert Wesarg
Subject: Re: [Bug-cpio] how to archive a file with size 0 and mode 0
Date: Thu, 13 Dec 2007 10:36:29 +0100

On Dec 13, 2007 10:29 AM, Sergey Poznyakoff <address@hidden> wrote:
> Bert Wesarg <address@hidden> ha escrit:
>
> > I have to archive files with a size of 0 and an st_mode of 0 (aka 
> > ----------).
> >
> > The file is for me stat(2)'able, but is not included in the archive.
> >
> > Is this somehow possible?
>
> I'm afraid not. Neither cpio nor tar are able to handle this.
Thanks for your confirmation.

I currently use this patch which works for me:

diff --quilt old/src/copyout.c new/src/copyout.c
--- old/src/copyout.c
+++ new/src/copyout.c
@@ -724,11 +724,14 @@ process_copy_out ()
                }
              in_file_des = open (orig_file_name,
                                  O_RDONLY | O_BINARY, 0);
              if (in_file_des < 0)
                {
-                 open_error (orig_file_name);
+                 if (file_hdr.c_filesize == 0)
+                   write_out_header (&file_hdr, out_file_des);
+                 else
+                   open_error (orig_file_name);
                  continue;
                }

              if (archive_format == arf_crcascii)
                file_hdr.c_chksum = read_for_checksum (in_file_des,

Regards,
Bert




reply via email to

[Prev in Thread] Current Thread [Next in Thread]