Give a path, get a function that will write to it