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.
a4partl folder1 folder2 file3 link4 file1 file2 a4partl folder1 folder2 file3 link4 file1 file2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started