Q:
How do I create a directory?
How do I remove a directory
(and its contents)?
A: If your operating system supports these services, they are likely to be provided in C via functions named mkdir and rmdir. Removing a directory's contents as well will require listing them (see question 19.20) and calling remove (see also question 19.16). If you don't have these C functions available, try system (see question 19.27) along with your operating system's delete command(s).
References:
PCS Sec. 12 pp. 203-4
POSIX Secs. 5.4.1,5.5.2