Advertisement
Guest User

Untitled

a guest
May 3rd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <limits.h>
  5.  
  6. int main(void){
  7.     FILE *fp;
  8.     int status;
  9.     char path[10], Info[400];
  10.  
  11.     fp = popen("ls *", "r");
  12.     while (fgets(path, 10, fp) != NULL){
  13.         strcat(Info, path);
  14.     }
  15.     status = pclose(fp);
  16.     printf("%s", Info);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement