Page 1 of 2

Programmatically accessing percentage complete output

Posted: Wed Oct 22, 2014 10:23 pm
by AntiqueTech
I am using usbitcmd.exe 1.69 inside my code (which is written in Java) to restore an image to a USB flash drive. I am using the /s switch so that usbitcmd reports its progress and my program can read it. However, my program does not get any output until usbitcmd finishes. I have tested my program by, instead of using usbitcmd.exe, using xcopy to list the files in a really large directory and by using a Java program I wrote that outputs a line every 0.5 seconds. Those two programs work fine - my program gets the output as they write it. Any idea why the output from usbitcmd would not be available immediately? Is the output being buffered? A similar thing is seen when you run usbitcmd.exe from the Windows command prompt and redirect the output to a file. Nothing is written to the file until usbitcmd finishes (as mentioned in a topic from last year and verified by me today).

Re: Programmatically accessing percentage complete output

Posted: Thu Oct 23, 2014 3:59 pm
by Alex
I have added it to the ToDo-List for the next version. Currently it's not working as intended.

Re: Programmatically accessing percentage complete output

Posted: Thu Oct 23, 2014 4:46 pm
by AntiqueTech
I appreciate that. For my planning purposes, do you have an estimate when the next version will be available? I am also willing to assist with testing that change.

Re: Programmatically accessing percentage complete output

Posted: Fri Oct 24, 2014 6:24 pm
by Alex
I have actually found a (quite easy) solution for the piped output issue. Now I just need to solve the issue mit .NET 4.0 and Windows XP, that occured with version 1.68. When that's done, I will release version 1.70. I hope it will be in the next days.

Re: Programmatically accessing percentage complete output

Posted: Mon Oct 27, 2014 7:02 pm
by AntiqueTech
Thanks. That sounds great. Also, is there an "off by 1" problem with the percentage output? It always starts with 0% and ends with 99% (assuming I am using an uncompressed image).

Re: Programmatically accessing percentage complete output

Posted: Mon Oct 27, 2014 7:41 pm
by Alex
The 0-99 is intentionally. The very moment, when the last byte is written, the progress bar should be 100%.

Re: Programmatically accessing percentage complete output

Posted: Thu Nov 06, 2014 5:51 pm
by schakal
Hi Alex, do you have some news according the release 1.70?

Re: Programmatically accessing percentage complete output

Posted: Thu Nov 06, 2014 8:51 pm
by Alex
It's available for download now.

Re: Programmatically accessing percentage complete output

Posted: Wed Nov 12, 2014 7:14 am
by schakal
Hallo Alex,

ich schreibs auf deutsch weil es da einfacher ist ;)

Also beim Restore von einem GZIP Image auf einen USB3 Stick an einem USB3 Anschluss bekomme ich eine %-Ausgabe von 1644%. Das passiert aber nur wenn das Image größer ist (in meinem Fall 60GB). Bei einem 1GB Image funktioniert das ohne Probleme. Ich versuche es noch mit einem 32GB Image.

Wenn du möchtest versuche ich das noch auf Englisch zu formulieren ;)

Gruß
Schakal

Re: Programmatically accessing percentage complete output

Posted: Wed Nov 12, 2014 8:17 pm
by Alex