Reputation: 49
While trying to append the Output from ProcessBuilder
to file using
redirectOutput(Redirect.appendTo(outFile).file())
, it always overwrites the existing data in the file , instead of appending the data to the existing file.
How to append data to an existing file from processbuilder
Any help would be appreciated.
Upvotes: 1
Views: 2135
Reputation: 310874
redirectOutput(Redirect.appendTo(outFile).file())
You're losing the append information. This should be:
redirectOutput(Redirect.appendTo(outFile))
Upvotes: 5