deva
deva

Reputation: 49

How to append the output from ProcessBuilder to file,without overwriting the exisiting data in file

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

Answers (1)

user207421
user207421

Reputation: 310874

redirectOutput(Redirect.appendTo(outFile).file())

You're losing the append information. This should be:

redirectOutput(Redirect.appendTo(outFile))

Upvotes: 5

Related Questions