Delete a directory recursively – Linux sample program

September 5th, 2008  |  by  |  published in Linux Sample Programs

// Author : Amit Sahrawat #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h>   #ifdef DEBUG #define TRC_SYSMNGR printf #else #define TRC_SYSMNGR  #endif #include <dirent.h> int deletepath(char *path) {  struct dirent *d = NULL; DIR *dir = NULL; /* pointer to directory head*/ char buf[64]={0}; /* buffer to store the complete file/dir name*/ struct stat […]

Subscribe

Get articles in your inbox.

Enter your email address:

Join Us

Twitter Chatter


Recommendations

Archives

Categories