Rewrite ls (linux) in C
bibounder
-
Sugel Posted messages 4293 Registration date Status Membre Last intervention -
Sugel Posted messages 4293 Registration date Status Membre Last intervention -
Hello,
I have a project to complete, which is to recode the "ls" command found in Linux.
Okay, this topic has already been addressed in other threads, but the problem is that we are not allowed to use printf, scanf, and all the other functions that would simplify our lives.
I have absolutely no idea where to start. Thank you in advance.
I have a project to complete, which is to recode the "ls" command found in Linux.
Okay, this topic has already been addressed in other threads, but the problem is that we are not allowed to use printf, scanf, and all the other functions that would simplify our lives.
I have absolutely no idea where to start. Thank you in advance.
4 réponses
Hello,
You need to see exactly what you are allowed...
System function (like read())? A few standard functions (like fread())?
Etc.
Best regards,
--
Google is your friend
You need to see exactly what you are allowed...
System function (like read())? A few standard functions (like fread())?
Etc.
Best regards,
--
Google is your friend
Good evening
To begin with, "LS" is not a function but a program that we call to list a directory and which takes arguments, and if other functions are prohibited for you, then you can use write for example
--
All knowledge is an answer to a question.
To begin with, "LS" is not a function but a program that we call to list a directory and which takes arguments, and if other functions are prohibited for you, then you can use write for example
--
All knowledge is an answer to a question.
You, you are at Epitech, you!
Start by recoding getchar and putchar, functions that allow you to respectively get and display a character.
Then, look towards the system APIs to list a directory.
Finally, you will need to work with structures and linked lists...
I'll leave you to search!
--
------------------------------------------------------------------------------------
"Fear leads to anger. Anger leads to hate. And hate... leads to suffering." - Yoda
Start by recoding getchar and putchar, functions that allow you to respectively get and display a character.
Then, look towards the system APIs to list a directory.
Finally, you will need to work with structures and linked lists...
I'll leave you to search!
--
------------------------------------------------------------------------------------
"Fear leads to anger. Anger leads to hate. And hate... leads to suffering." - Yoda