WANTED: cpio command

The cpio command reads and writes archives in the cpio format. As cp means copy, cpio means copy in/out. The jRPM project at sourceforge.net happens to provide a CPIOInputStream and CPIOOutputStream.

How do you copy files from one JNode machine to another?

Are you volunteering?

Hey this is fun. I could post this comment on every suggestion that you make gchii Smiling

But seriously, you know the deal. We have plenty of suggestions from "the peanut gallery", but we are desperately short of people actually working on JNode. I know that you have the technical skills to implement a cpio command for JNode ... so why don't you just do it?

View from the peanut gallery

From the view of the peanut gallery, I am just wondering out loud about how other people working with JNode copy files in and out of a running installation. When I upgrade from JNode 0.2.7 to 0.2.8, how do I keep my files? Does anyone keep their files?

The typical use of cpio depends upon redirecting a file to standard input and redirecting standard output to a file. Getting cpio to work requires more than just a cpio command.

When working with cpio archives, I do not actually use the POSIX-compatible cpio command. I have broken away from traditional POSIX-style thinking. I have demonstrated, for example, that it is not necessary to invoke an archive command in another isolate when we already have a filter stream framework.

When cpio archive reading and writing is implemented in an existing class library, the cpio command itself only provides a command-line interface to the library. And since the filter input stream already has a "command line" interface, the cpio command exists only for the purpose of POSIX compatibility. POSIX compatibility requires a developer to understand the command-line syntax in XML, which I do not yet understand.

I salute you.

If you actually need cpio ...

... I suggest that you implement it and contribute it.

Please don't just sit in the peanut gallery making "helpful" suggestions. As far as I am concerned, it is not helpful. I mean ... it is not as if we (the developers) are not smart enough to figure out that we will need a 'tar' or 'cpio' or 'zip' program fairly soon.

If you really want to be helpful, get off your backside and write some code for JNode.

cpio command specification

Issue 2831 makes a note of the need for gzip, tar, zip, and other commands.

Let's start thinking outside the box. Let's cooperate on the construction of a command. JNode needs commands. Who knows how to push the command-line syntax? I don't. Not yet.

Therefore, I propose the following approach to cooperation on missing commands. It might serve to accelerate the 3rd party contribution to the project.

  1. Nominate a command. Anyone can nominate a command.
  2. Set a priority on a command. A command with the highest priority should be finished first, right?
  3. One developer pushes the command-line syntax and writes a skeleton .java file. This developer commits the .java file to SVN.
  4. Another developer completes the skeleton .java file. This developer contributes a patch.

What do you think? A skeleton command displays a message, something like this: This feature is not yet implemented. It throws an exception or whatever indicates that the command has failed.

(Furthermore, is it possible to start with an XML file with command-line syntax and automatically generate a skeleton .java file? Sure it is.)

The cpio command specification starts with this:

  • cpio reads from standard input and writes to standard output. It depends upon redirection.
  • -i and -o are mutually exclusive.
  • -i copies files into the file system. This option is used to un-archive, read an existing cpio-compatible archive.
  • -o copies files out of the file system. This option is used to create a cpio-compatible archive.
  • -v (--verbose) displays additional messages.
  • -d creates directories.

Reference: http://en.wikipedia.org/wiki/Cpio

Here's a better idea ...

Why don't you read The new command line syntax mechanism and the four child pages. Pay particular attention to the "worked example" page. There is more information on the APIs to be found in the Javadocs.

See if you can figure out how to specify cpio's JNode command line syntax in XML yourself. By the sounds of it, the syntax should be dead simple. Then try to implement the JNode specific part of the command class based on the worked example and the Javadocs. If you get stuck, I'll help out. But if I write the syntax spec, etc for you, you won't learn much in the process.

The advantage of this approach are that you will learn more, and that you can give me with some decent feedback on the documentation, which will help me to improve it.