Swift app is launching an instance of itself. When it does that it sets the output using FileHandle(forWritingTo: & ends up writing to the top of the target file, not appending to the end.
The output is landing in the right file, but at the top. Any idea why & how this can be fixed ?
do{
let opURL = URL(string: "file:///Users/j238/output.txt")
let opFile = try FileHandle(forWritingTo: self.opURL!)
task.standardOutput = opFile
task.standardError = opFile
}catch let error as NSError {
print("Ooops! Something went wrong with setting output: \(error)")
}