I thought I'd start a thread to document error codes generated while trying to write or create files. Someone was asking about this not too long back in this thread, and it seemed an answer wasn't found:
So here's two from trial-and-error:
error -1 creating file
- means that directory does not exist
error -5000 creating file
- means that user does not have permission to write to directory
Hope this helps someone... please add any error codes you find!