Always helps if you make sure the directory your trying to create a file in actually exists.