partimage + stdout, existing code

March 30, 2007

0 minute read

On first inspection it looks like some code already exists for writing an image to stdout (standard output).

image_disk.cpp, line 558

  if (strcmp(m_szImageFilename, "stdout"))    {      //... network output code hidden for clarity ...    }  else // it's stdout    {      m_fImageFile = stdout;      showDebug(1, "image will be on stdout\n");    }

Unlike stdin for restore, stdout for save is not currently available in the command line options. I did do a build earlier where I enabled it (which I don’t have any more due to my build problems). I managed to pipe an image to hexdump and seemed to be able to see some of the user interface info in the output.

It would seem the problem with the stdout option is that even in batch mode the program outputs interface data to stdout, which then corrupts the image.

I think I shall attempt to remove all the UI stuff, and make it act more like all the other unix tools. Might also try to create a reusable library out of it.

Share: Tweet | LinkedIn
Suggest improvements: page source on github

Get extra content that's just for my list. Get new blog posts to your inbox.
Join me on my journey through software and business.