Large file archiving problem

View: New views
2 Messages — Rating Filter:   Alert me  

Large file archiving problem

by Ladislav Michnovič-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

I have a problem which is reproducible with the latest 2.9.90 version
and also with older versions.
echo /tmp/bigfile  | cpio -ocv >/dev/null
cpio: /tmp/bigfile: field width not sufficient for storing file size
The bigfile has 9885665280 bytes.
I thought LFS should handle this.

A colleague of mine has suggested this patch

--- copyout.c.old       2008-02-20 14:27:39.000000000 -0800
+++ copyout.c   2008-02-21 13:52:26.000000000 -0800
@@ -126,7 +126,7 @@
   to_ascii_or_warn (p, file_hdr->c_mtime, 8, LG_16, file_hdr->c_name,
                     "modification time");
   p += 8;
-  if (to_ascii_or_error (p, file_hdr->c_filesize, 8, LG_16, file_hdr->c_name,
+  if (to_ascii_or_error (p, file_hdr->c_filesize, 9, LG_16, file_hdr->c_name,
                          "file size"))
     return 1;
   p += 8;

but I'm not sure if this solution is a good idea.
What is your opinion?

Regards Ladislav.


_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio

Re: Large file archiving problem

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ladislav Michnovi­ <ladislav.michnovic@...> ha escrit:

> I have a problem which is reproducible with the latest 2.9.90 version
> and also with older versions.
> echo /tmp/bigfile  | cpio -ocv >/dev/null
> cpio: /tmp/bigfile: field width not sufficient for storing file size
> The bigfile has 9885665280 bytes.
> I thought LFS should handle this.

It is a limitation of 'new ascii' format. There's probably nothing that
can be done about it. I'd suggest using another format instead. None
of the cpio formats are able to store files greater than 8G, so you will
need to use tar to archive such files.
 
> A colleague of mine has suggested this patch

With this patch cpio will not be able to read archives it produces.
Even if copyin.c and cpiohdr.h are modified to reflect this change,
the resulting patch will make GNU cpio incompatible not only with other
cpio implementations, but even with its own prior versions.

Regards,
Sergey



_______________________________________________
Bug-cpio mailing list
Bug-cpio@...
http://lists.gnu.org/mailman/listinfo/bug-cpio