def appendToRawFile()

in python/awsgs.py [0:0]


def appendToRawFile(outputFile, data):

    #   Writes received Bytes to outputFile

    #   Open file handle
    try:
        f = open(outputFile, "ab")
        num_bytes_written = f.write(data)

        #   Make sure the buffer is flushed correctly
        f.flush()
        os.fsync(f.fileno())
        return num_bytes_written
    except Exception as e:
        print(" (ERR) File open error: %s" % e )
        return 0