Ensuring that './public/graphs' exists before trying to write a file there