B4J Question Live output from Shell?

aidymp

Well-Known Member
Licensed User
Longtime User
Is it possible to see and capture live output from shell?

I am going to attempt to use 7-zip via shell, as the Archiver lib is not suitable for me.

I would like to capture/display the output in real time, not at the end when the command has finished! eg see if I can update a progress bar based on the shell stdout is this possible our would i be wasting my time??

Thanks

Aidy
 

Roycefer

Well-Known Member
Licensed User
Longtime User
jShell has events called _StdOut and _StdErr. I think these are raised anytime there's new data on those streams. I've had mixed success working with those events, though.

There's another amusing hack you could try, though. You could redirect Standard Out and Standard Error to files in your jShell code and then watch those files with the jFileWatcher library. When those files are modified, you will get events raised and then you can inspect the contents of those files for info on how your 7-zip process is coming along.

But I would try the _StdOut and _StdErr events, first.
 
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User

Thanks I will look into that! it sounds promising!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…