cp.c
// Whether the file is a directory
Whether the file is a directory
Whether the file is a directory
int isdir(int fd) {
    struct stat st;
    fstat(fd, &st);
    return st.type == T_DIR;
}
int isdir ( int fd ) { struct stat st ; fstat ( fd , & st ) ; return st . type == T_DIR ; }
Whether the file is a directory
Whether the file is a directory