All pastes #635670 Raw Edit

Etwas

public text v1 · immutable
#635670 ·published 2007-07-27 08:39 UTC
rendered paste body
#include <stdio.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(void){

 static struct dirent    *dp;
 DIR                     *dirp;
 struct stat stat_buf;

 dirp = opendir(".");
 while ((dp = readdir(dirp)) != NULL) {
  if ( stat (dp->d_name, &stat_buf) == 0 && S_ISREG (stat_buf.st_mode) ) { printf("stat: yes  "); }
  printf("%s %i\n",dp->d_name,(char)dp->d_type);
 }

 return 0;
}