C how to check if what's entered is file or dir code example
Example: c check dir/file
#include
#include
#include
int is_regular_file(const char *path)
{
struct stat path_stat;
stat(path, &path_stat);
return S_ISREG(path_stat.st_mode);
}