diff --git a/boxmox/data.py b/boxmox/data.py index 9982edea559572556588a6f9687761944351c13f..6872bc1af12a2b37cb7d8d15df03aa924c8ce9f9 100644 --- a/boxmox/data.py +++ b/boxmox/data.py @@ -268,6 +268,15 @@ class Output(object): os.remove(self.fpath) except Exception as e: raise("Removing output file did not work: {:s}".format(str(e))) + def write(self, f=sys.stdout): + ''' + Write contents of Output into file + + :param File f: file object or stream where to write to, defaults to sysout. + ''' + with open(self.fpath, 'rb') as i: + for line in i: + f.write(i) def copy(self, target_path): ''' Copy output file to target_path