www.tutorialspoint.com Forum Index
Register FAQMemberlistUsergroupsTutorials PointLog in
Reply to topic Page 1 of 1
Help needed to code same like a ls-lR in unix
Author Message
Reply with quote
Post Help needed to code same like a ls-lR in unix 
Task
You are required to write a C program under linux that produces the same output as

ls –lR <pathname>.

without the group gid of each file.

Your program must either have the following program structure, or if you have chosen a different structure, a detailed explanation of why you have chosen this structure.




A note on programming style
Programs should be decomposed into functions, and a function should do only one thing

Print more file details. the function calling hierarchy should be
main(int argc, char **argv) //only checks arguments
recls(“.”) //that contains the stat buffer
lsdetails(struct stat *statbuff)
time(time_t time) //might need a new name
perms(mode_t mode)
hlinks(nlink_t, linkbit)
slink(mode_t, mode)
owner(uid_t owner)
type(mode_t mode)

your program should be readable and understandable without needing comments. You should construct a suitable file structure to test your program.

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum