I'm a new comer in this forum and I also a newbie in linux world. I'm a student. So, i hope
i'll get more knowledge here.
Okay, here is my first post (and my first problem too :P )
Yesterday, my lecturer give me assignment about file system chapter. He asked me to make a
program with gcc that simulate an "ls-like" command. I mean, i'm asked to make a program
that can display the contents of a directory (maybe files or other directories). And the
program can also recieve arguments, such as:
-a to display all of contents, including the hiding ones
-l to display in a list views
-R to display recursively (display the contents of it's subdirectories too)
-d to display only the directory type content (subdirectory)
The second problem:
I'm asked to make a program with gcc that can display the contents of a file, with
-c(n) to display in column views (n is the number of column)
-t(h|d) to display in h=hexa or d=decimal
Phew...can you imagine my frustated? So, anybody help me please...
C or C++?
We don't do your homework. What's your approach? What's your specific problem? What code have you already written?
opendir ( ) / readdir ( ) / closedir ()
To get all the files in a directory
stat() to get extended information on a file, like its permissions, size etc.