def writefile(stringdata, path):
    '''Writes string data to path.
    Returns the path on success, empty string on failure.'''
    try:
        fileobject = open(path, mode='w', buffering=1)
        print >> fileobject, stringdata.encode('UTF-8')
        fileobject.close()
        return path
    except (__HOLE__, IOError):
        munkicommon.display_error("Couldn't write %s" % stringdata)
        return ""
dataset/ETHPy150Open munki/munki/code/client/munkilib/adobeutils.py/writefile