diff options
| author | Abdellah El Morabit <nsrddyn@gmail.com> | 2025-02-22 13:16:03 +0100 |
|---|---|---|
| committer | Abdellah El Morabit <nsrddyn@gmail.com> | 2025-02-22 13:16:03 +0100 |
| commit | cdbd4471aadb918c6631f9cd18bff4b98fbef99c (patch) | |
| tree | aa2eba1daaca27255a4df3bb92ffe7fd4b645a06 /ls.c | |
| parent | e6b16a313f3ab539f5baba4ab027778165a2f535 (diff) | |
i think everything works except for the new features im planning on adding and the remove file/ directory permissions but i dont know how to do that yet
Diffstat (limited to 'ls.c')
| -rw-r--r-- | ls.c | 42 |
1 files changed, 0 insertions, 42 deletions
@@ -1,42 +0,0 @@ -/* - * ===================================================================================== - * - * Filename: ls.c - * - * Description: - * - * Version: 1.0 - * Created: 02/18/2025 15:39:55 - * Revision: none - * Compiler: gcc - * - * Author: YOUR NAME (), - * Organization: - * - * ===================================================================================== - */ -#include <stdlib.h> -#include <stdio.h> -#include <dirent.h> - - -int main(){ - - char *path = "folder"; - struct dirent *entry; - DIR *dP = opendir(path); - - // check if the directory got opened successfully - if (dP == NULL) { - perror("opendir"); - return 1; - } - - // print the folder|directory name - while ((entry = readdir(dP)) != NULL) { - char *temporary_variable = entry->d_name; - printf("%s\n", entry->d_name); - } - closedir(dP); - -} |
