Happy new year ! :)
I have a question about stat() function.
Im trying to check if a given file argument is a directory or not, using stat() function ?
I couldnt find any examples. Can u help me with this ?
I found a small example but it doesnt help me.
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
struct stat buf;
stat(argv[1],&buf);
exit(0);
}


Sign In
Create Account

Back to top









