Not a directory
- You are trying to do something to a file where a directory would be expected. eg
- chdir("/etc/motd");
- This more frequently (and confusingly) occurs when you are refering to a file, where you would expect a file to work, but the directory path is wrong, eg
- fopen("/etc/motd/foo","r");
because "/etc/motd" is a file, not a directory, and therefore can't "contain" "/foo".
This can happen when creating a unix domain socket with socket(2) and bind(2) or connect(2) for the same reason, (you're trying to create a socket like /etc/motd/foo where motd is a file not a directory).