Programmatically accessing percentage complete output

USB Image Tool support forum
AntiqueTech
Posts: 6
Joined: Mon Sep 29, 2014 3:14 pm

Programmatically accessing percentage complete output

Post 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).
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Programmatically accessing percentage complete output

Post by Alex »

I have added it to the ToDo-List for the next version. Currently it's not working as intended.
AntiqueTech
Posts: 6
Joined: Mon Sep 29, 2014 3:14 pm

Re: Programmatically accessing percentage complete output

Post 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.
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Programmatically accessing percentage complete output

Post 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.
AntiqueTech
Posts: 6
Joined: Mon Sep 29, 2014 3:14 pm

Re: Programmatically accessing percentage complete output

Post 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).
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Programmatically accessing percentage complete output

Post by Alex »

The 0-99 is intentionally. The very moment, when the last byte is written, the progress bar should be 100%.
schakal
Posts: 2
Joined: Mon Nov 03, 2014 8:10 pm

Re: Programmatically accessing percentage complete output

Post by schakal »

Hi Alex, do you have some news according the release 1.70?
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Programmatically accessing percentage complete output

Post by Alex »

It's available for download now.
schakal
Posts: 2
Joined: Mon Nov 03, 2014 8:10 pm

Re: Programmatically accessing percentage complete output

Post 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
Alex
Site Admin
Posts: 267
Joined: Fri Jul 29, 2011 11:59 pm

Re: Programmatically accessing percentage complete output

Post by Alex »

Post Reply