<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def string_to_file(path, input):
 """ Write a file from a given string. """

    mkdir_p(os.path.dirname(path))

    with codecs.open(path, "w+", "UTF-8") as file:
        file.write(input)