Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C/C++ program to create directories and files. First, create a directory named cs3377 (if you do not have created it yet; it is created for

image text in transcribed

C/C++ program to create directories and files. First, create a directory named cs3377 (if you do not have created it yet; it is created for your Assignmentl), and change current working directory to cs3377 For this part, you may review APUE Chapter 3 and Chapter 4 for some of the system API calls of which you may use: open, read, write, chdit. mkdir. stat, chmod, link, access, svmlink, getswd, etc. For example, in your program, you use "getud" call to find out your current working directory, "chdic" call to change directory "mkdix call to create a directory, "open" to create a new file, etc. For time-date format and output, see APUE 6.10. For funk(create and read), see APUE 4.18 Note. Your program should not use any of "svstemcalls for this part. Task#1. Design and implement C/C++ program (a2part1.c or a2part1.cpp, and its executable named a2part 1) to create directories and files, and/or to navigate the directories as shown below This is your surens directory which is a2part1 (in cs3377) dirl dir2 file3.txt inkl filel.txt dirl1 file2.txt file11.txt Before and after each call (e.g., to create a file or to create a directory), your program should print a message with a time-stamp (e.g.,"** created dirl at 2018.09.29 13:59 **"). Task#2. After completing Task#1, your program should change its current working directory (to "a2part 1"), to display each directory entry information of this directory and its all subdirectories. You should use "readdir" in APUE 4.22 and "stat" in APUE4.2 to display each directory entry information (similar to what "1s-1" command displays). C/C++ program to create directories and files. First, create a directory named cs3377 (if you do not have created it yet; it is created for your Assignmentl), and change current working directory to cs3377 For this part, you may review APUE Chapter 3 and Chapter 4 for some of the system API calls of which you may use: open, read, write, chdit. mkdir. stat, chmod, link, access, svmlink, getswd, etc. For example, in your program, you use "getud" call to find out your current working directory, "chdic" call to change directory "mkdix call to create a directory, "open" to create a new file, etc. For time-date format and output, see APUE 6.10. For funk(create and read), see APUE 4.18 Note. Your program should not use any of "svstemcalls for this part. Task#1. Design and implement C/C++ program (a2part1.c or a2part1.cpp, and its executable named a2part 1) to create directories and files, and/or to navigate the directories as shown below This is your surens directory which is a2part1 (in cs3377) dirl dir2 file3.txt inkl filel.txt dirl1 file2.txt file11.txt Before and after each call (e.g., to create a file or to create a directory), your program should print a message with a time-stamp (e.g.,"** created dirl at 2018.09.29 13:59 **"). Task#2. After completing Task#1, your program should change its current working directory (to "a2part 1"), to display each directory entry information of this directory and its all subdirectories. You should use "readdir" in APUE 4.22 and "stat" in APUE4.2 to display each directory entry information (similar to what "1s-1" command displays)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Solve the differential equation. (e y - 1) y' = 2 + cos x

Answered: 1 week ago

Question

For the reaction: 2HHBr(g)+H2(g)+Br(r(g)

Answered: 1 week ago