Question: Write a C/C++ program (a4part2.c) to do the following tasks. (1) Your C program will change the current working directory to a4part1, and call pwd
Write a C/C++ program (a4part2.c) to do the following tasks.
(1) Your C program will change the current working directory to a4part1, and call pwd and then it will call ls function to list all the directories and files using R option.
Your C program will navigate the directory structure (as shown in Part1) to visit each subdirectory.
(2) it will list each directory entry and its type.
(3) it will list the inode of each entry with the file-type (e.g., regular file, symbolic link, etc.).
(4) as your C program navigates the directory structure, it will check whether the current directory which it visits has a subdirectory or not. If not, then it will output a message:
** folder1 - this directory does not have any subdirectory **
DIRECTORY STRUCTURE IS AS FOLLOWS: INSIDE DIRECTORY A4PART1: FOLDER1, FOLDER2, FILE3, LINK4
INSIDE FOLDER1: FILE1.TXT
INSIDE FOLDER2: FILE2.TXT(SYMBOLIC LINK4 IN A4PART1 WILL LINK TO THIS FILE)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
