Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/stat.h>
- #include <cerrno>
- #include <iostream>
- #include <cstring>
- std::string errorString(int errno){
- return std::strerror(errno);
- }
- int main(){
- struct stat sb;
- errno = 0;
- if(stat("/jdfj/", &sb)){
- errorString(errno);
- }
- else{
- std::cout << std::boolalpha << S_ISDIR(sb.st_mode) << std::endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement