Linux files exercises
-
Write a program to emulate the behaviour of the Unix cat command as follows:
If no command line arguments are given, the program should write its standard input to its standard output. If arguments are given, then treat them as filenames and copy the contents of each in turn to standard output.
Solution is in sol/mycat.c
-
You will notice that if you give a directory name as an argument to your program for question 1, then an error will occur or garbage will be displayed (the exact symptoms differs between operating systems).
Modify your program from question 1 so that it detects the fact that a directory has been chosen, and report a suitable error message to the user.
Solution is in sol/mycat2.c
Recent Stories
Top DiscoverSDK Experts
Compare Products
Select up to three two products to compare by clicking on the compare icon () of each product.
{{compareToolModel.Error}}
{{CommentsModel.TotalCount}} Comments
Your Comment