Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

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

Step: 3

blur-text-image

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

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions

Question

Which form of proof do you find least persuasive? Why?

Answered: 1 week ago