aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/cpio.c
AgeCommit message (Collapse)Author
2014-03-25Promote cpio out of pending.Rob Landley
After some waffling I put it in "posix", even though it was last specified in susv2 (where it was the obsolete 6 byte header entries predating susv4). LSB specifies it, including the 8 byte header fields, but for the actual command it just references SUSv2. (LSB isn't so much a standard as Red Hat's "notes to self".)
2014-03-25Several cpio bugfixes spotted by Isaac Dunham.Rob Landley
2014-03-24Most of the remaining cpio cleanup.Rob Landley
2014-03-15Next round of cpio cleanup.Rob Landley
2014-03-13Cleanup cpio: use getline() instead of fgets(), have getline() allocate its ↵Rob Landley
own memory (instead of using toybuf), use perror_msg() instead of lower level verror_msg() (which is really an internal function needed to implement perror_msg()), don't set execute bits on created archive.
2014-03-13Cleanup cpio: fiddle with help text, make option parsing require/exclude ↵Rob Landley
-iot combinations, move loopfiles_stdin() down after write_cpio_member() so we can hardwire it instead of using a function pointer that only ever has one value.
2014-03-11Patch from Isaac Dunham to add cpio -d, with a few tweaks by me.Rob Landley
2013-12-01Minor drive-by cleanups to cpio. Whitespace, curly brackets, replace %4 with ↵Rob Landley
&3, turn a switch/case into if/else.
2013-11-16Support -F, and ignore -u since that's what we do anyway.Isaac Dunham
(Really, checking the original file date is the Right Thing, but I haven't written it yet.)
2013-10-27Here's a revised cpio.Isaac Dunham
I've reduced the use of malloc(), dropped an extra function call, and -at least in theory- allowed proper handling of non-regular files. (If we have a file we can't read, we still should record it when it's of a type where file content is ignored).
2013-10-14I've finally gotten 'cpio' into a shape where it could be useable.Isaac Dunham
This version can archive and extract directories, sockets, FIFOs, devices, symlinks, and regular files. Supported options are -iot, -H FMT (which is a dummy right now). It only writes newc, and could read newc or newcrc. This does NOT implement -d, which essentially is equivalent to mkdir -p $(dirname $FILE) for every file that needs it. Hard links are not supported, though it would be easy to add them given a hash table or something like that. I also have not implemented the "<n> blocks" output on stderr. If desired, I can add it pretty simply. There is one assumption this makes: that the mode of a file, as mode_t, is bitwise equivalent to the mode as defined for the cpio format. This is true of Linux, but is not mandated by POSIX. If it is compiled for a system where that is false, the archives will not be portable.