#include #include #include #include #include #include #define TRUE 1 #define FALSE 0 int main (int argc, char *argv[]) { struct stat file_stat; char remote_filename[1280]; // 1024+256 (1024 bytes for path and 256 bytes for filename) int directory_exists; directory_exists = FALSE; strcpy (&remote_filename[0], "./my_directory"); if (stat (&remote_filename[0], &file_stat) == 0) { directory_exists = TRUE; } else { if (mkdir (remote_filename, 0755) == 0) { directory_exists = TRUE; } else { printf ("mkdir() failed creating %s\n", remote_filename); } } }