[Interest] Help parsing output of "mksquashfs" command

Elvis Stansvik elvstone at gmail.com
Fri Jun 3 13:22:27 CEST 2016


2016-06-03 12:32 GMT+02:00 Juan Navarro <oneorjuan at gmail.com>:
> Hey Elvis, thank you for the tip. I'm convinced that this is the source of
> the problem: the "output device" to which "mksquashfs" is writing, doesn't
> show any number of "available columns" in my C++ code, thus it is probably
> generating a progress bar of length 0. With a pseudo terminal as you
> described, it will take the correct size and print a real progress bar.
> Thanks! Also you made me have another look at the KDE Core libraries, which
> will probably be of great help some day...
>
> I'm not very fond though of introducing several extra dependency libraries
> just to show progress in a small part of the application's purpose :-(

I can understand that, but you won't find anything in Qt to manage
PTYs in a portable way, so unless you want to set up the PTY and fork
the process manually (with fork/openpty, which is unportable), you're
going to need to depend on something. And CoreAddons + Pty from KF5
are relatively small libraries that only depend on Qt 5 (well
coreaddons seems to depend on Gamin as well). The good thing about
KPty is that it hides the platform peculiarities.

> I think the better solution is convince the makers of this little tool to
> make its output a bit more parseable.

Yes, I would think they could be open to that. Another alternative is
to ask them to make the functionality of the tool available as an easy
to use library, but that's more unlikely.

Elvis



More information about the Interest mailing list