Create a program in C with the following sequence of commands: if (mkdir(/tmp/foo, DIR_PERM) < 0) err_sys(mkdir
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a program in C with the following sequence of commands:
if (mkdir("/tmp/foo", DIR_PERM) < 0)
err_sys("mkdir failed");
if (chdir("/tmp/foo") < 0)
err_sys("chdir failed");
if (rmdir("/tmp/foo") < 0)
err_sys("rmdir failed");
Does the program succeed? What happens if the program attempts to read the current directory?
Related Book For
Organisational Behaviour In The Workplace
ISBN: 9781292245485
12th Edition
Authors: Jacqueline Mclean, Laurie Mullins
Posted Date: