int write(string path, string data, int offset)
Write data to the file. Should write all data.
errno or amount written (bytes)