Displaying 2 results from an estimated 2 matches for "printdir".
2009 Jun 03
3
How to get file info of a directory in linux kernel space?
...to do this in linux kernelspace ? thank you very much!
/*********************************************************************/
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
void printdir(char *dir, int depth){
DIR *dp;
struct dirent *entry;
struct stat statbuf;
if((dp = opendir(dir)) == NULL){
fprintf(stderr,"cannot open directory: %s\n",dir);
return;
}
chdir(dir);
while((entry = readdir(dp)) != NULL){
lstat(en...
2009 Jun 03
3
How to get file info of a directory in linux kernel space?
...to do this in linux kernelspace ? thank you very much!
/*********************************************************************/
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
void printdir(char *dir, int depth){
DIR *dp;
struct dirent *entry;
struct stat statbuf;
if((dp = opendir(dir)) == NULL){
fprintf(stderr,"cannot open directory: %s\n",dir);
return;
}
chdir(dir);
while((entry = readdir(dp)) != NULL){
lstat(en...