Question: Help in Unix bash Do not use system() function call in your program. Write a C/C++ program (a4part1.c) to create a few directories as shown

Help in Unix bash

Do not use system() function call in your program.

Write a C/C++ program (a4part1.c) to create a few directories as shown below in your current directory, a few files, and a symbolic-link link1.

You should use some of the following system functions .

open, openat, creat, open, lseek, read, write.

stat, fstat, fstatat, lstat, access, faccessat, umask, chmod, fchmod, fchmodat, chown, fchown, fchownat, lchown, link, linkat, unlink, unlinkat, remove, rename, renameat, symlink, symlinkat, mkdir, mkdirat, rmdir, chdir, fchdir, getcwd

For example, to change current directory, you should use chdir( ) function to change the directory. You should use creat() function to create each file.

First (1), your C program will create a directory (a4part1) for this assignment, and then create the files and directories as shown below, using C function call(s), recursively (that is, in depth-first order and left to right). That is, folder1 will be created first, then file1, and so on. You should create link1 (a softlink to file2) after file3 is created.

Second (2), you type the command ("ls R") to get the listing of all the directories and files in a4part1 directory.

Help in Unix bash Do not use system() function call in your

a4partl folder1 folder2 file3 link4 file1 file2 a4partl folder1 folder2 file3 link4 file1 file2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!