14. Strings
Make 14_Strings subdirectory. All code should reside there.
Write a program catargs.c that concatenate all the command line parameters in one string (this is required) and prints this string with "<" and ">":
$ ./catargs qwe ASD "1 2 3" <qweASD1 2 3>
Look at lsdir2.c program from ../Lab_12_DirectoryWalk. Modify it to do recursive directory listing.
- Do not forget to free what you've malloc-ed
Add second shift parameter to listdir(), initially 0, to make every recursive listdir() call insert shift spaces before printing a file object name. Increase shift by 2 every recursive call.
$ ./lsdir2 ../13_Permissions2/ a.out: 8 o.c: 8 o: 8 proj: directory prog.o: 8 lib.o: 8 prog: 8 lib.c: 8 Makefile: 8 prog.c: 8 dir: directory
Look at lsdir3.c program from ../Lab_12_DirectoryWalk. Modify it:
To make a recursive list, like previous one, and print every directory, but only matching file names.
To check exit status of every function and print error message with perror (e. g. ./lsdir3 /tmp or ./lsdir3 /etc/ shall stop normally on sugon server).
H/W
Finish all tasks