Grab command line mode output with Java ProcessBuilder
-
- Posts: 15
- Joined: Sun Feb 28, 2021 9:06 am
Grab command line mode output with Java ProcessBuilder
Hello anybody,
does someone has experience in grabbing the command line output with the Java ProcessBuilder API?
I'm playing around with the command line mode and some lines of Java, but couldn't grab the std::cout from cloud compare in command line mode.
Is this possible on windows with powershell?
does someone has experience in grabbing the command line output with the Java ProcessBuilder API?
I'm playing around with the command line mode and some lines of Java, but couldn't grab the std::cout from cloud compare in command line mode.
Is this possible on windows with powershell?
Regards Sebastian
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Grab command line mode output with Java ProcessBuilder
I know for sure the windows output is being sent to the command line correctly so it should be available in powershell. but we only redirect to the console output in -SILENT mode. are you using -SILENT?
-
- Posts: 15
- Joined: Sun Feb 28, 2021 9:06 am
Re: Grab command line mode output with Java ProcessBuilder
Yes, I did use the option.
My command is called this way:
Code: Select all
-SILENT
My command is called this way:
Code: Select all
"open", "-a", "CloudCompare.app", "-n", "--args", "-SILENT", "-NO_TIMESTAMP", "-C_EXPORT_FMT", "LAS", "-O", "/Users/set3/pcl_1.las", "-O", "/Users/set3/pcl_2.las", "-MERGE_CLOUDS"
Regards Sebastian
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Grab command line mode output with Java ProcessBuilder
I'm not sure if the silent commands gets redirected on Mac to the standard console, you could run the same command in a terminal to see if it does.
-
- Posts: 15
- Joined: Sun Feb 28, 2021 9:06 am
Re: Grab command line mode output with Java ProcessBuilder
I copied the files to a shorter folder structure and test it with the terminal command (zsh shell)
It opens the Command Line Mode Window, like the Java approach.
An additional "-SILENT" let the app run in the background, (I can see the merged point cloud), but no output to the console.
Code: Select all
open -a CloudCompare.app --args -NO_TIMESTAMP -C_EXPORT_FMT LAS -O /Users/s/cc/pcl_1.las -O /Users/s/cc/pcl_2.las -MERGE_CLOUDS
An additional "-SILENT" let the app run in the background, (I can see the merged point cloud), but no output to the console.
Code: Select all
open -a CloudCompare.app --args -SILENT -NO_TIMESTAMP -C_EXPORT_FMT LAS -O /Users/s/cc/pcl_1.las -O /Users/s/cc/pcl_2.las -MERGE_CLOUDS
Regards Sebastian
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Grab command line mode output with Java ProcessBuilder
After looking into it, doesn't look like there is a simple solution.
https://stackoverflow.com/questions/601 ... ng-termina
I don't have any Mac systems to test anything on so I believe unless a Mac developer wants to step forward, not sure if this will be fixed
https://stackoverflow.com/questions/601 ... ng-termina
I don't have any Mac systems to test anything on so I believe unless a Mac developer wants to step forward, not sure if this will be fixed
-
- Posts: 15
- Joined: Sun Feb 28, 2021 9:06 am
Re: Grab command line mode output with Java ProcessBuilder
Man, you made my day, or better evening! With your input, everything becomes clear and the fog is gone away.WargodHernandez wrote: ↑Mon Mar 01, 2021 9:53 pm After looking into it, doesn't look like there is a simple solution.
https://stackoverflow.com/questions/601 ... ng-termina
I don't have any Mac systems to test anything on so I believe unless a Mac developer wants to step forward, not sure if this will be fixed
I use the following command to access the CloudCompare executable.
Code: Select all
"/Applications/CloudCompare.app/Contents/MacOS/CloudCompare", ...
Regards Sebastian
-
- Posts: 15
- Joined: Sun Feb 28, 2021 9:06 am
Re: Grab command line mode output with Java ProcessBuilder
You are wright. I take a short dive into a threadded solution for reading the inputstream. But it doesn't work at the moment.WargodHernandez wrote: ↑Mon Mar 01, 2021 9:53 pm After looking into it, doesn't look like there is a simple solution.
One question there: Flushes CloudCompare the stream buffer after every step, or after finishing all steps at once?
At the moment I got all input stream lines after CloudCompare had done its job.
Regards Sebastian