aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/cpio.c
AgeCommit message (Collapse)Author
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.