how to check if directory/file exist using c/c++

Hi there,

how to check if directory/file exist using c/c++ under linux/unix. Thanks.

Steven

Use the stat call.

struct stat st;
if(stat("/tmp",&st) == 0)
        printf(" /tmp is present\n");

vino,
Thank you very much.
Steven