Tag Archives: Create Linux ls command

Create Linux ls command C Program

Create Linux ls command C Program – Write a C program under Windows Operating System to create or simulate linux ls command.   Program code #include<stdio.h> #include<dirent.h> int main(int argc, char **argv) { DIR *dp; struct dirent *link; dp=opendir(argv[1]); printf(“\n contents of the directory %s are \n”, argv[1]); while((link=readdir(dp))!=0) printf(“%s\n”,link->d_name); closedir(dp); } Output contents of… Read More »

Loading