The API for creating a new directory (or sub-directory) in the IFS is called "mkdir()." This stands, appropriately, for "make directory."
Here are the C language and RPG prototypes for the mkdir() API. They're straightforward, so I will not bore you with the conversion details,
int mkdir(const char *path, mode_t mode)D mkdir PR 10I 0 ExtProc('mkdir')
D path * Value options(*string)
D mode 10U 0 Value
For example, consider the following code:
C if mkdir('/ifstest/ShoeTongue': C S_IRUSR+S_IWUSR+S_IXUSR+ C S_IRGRP+S_IWGRP+S_IXGRP+ C S_IROTH+S_IXOTH) < 0 C callp EscErrno(errno) C endif
This code creates a new sub-directory called "ShoeTongue" inside the a directory called "/ifstest". It grants read, write and search permissions to the owner, read, write and search permissions to the primary group, and read and search permissions to everyone else.
In order for this command to exist, the "/ifstest" directory must already exist. If not, the command will fail with "path or directory not found!"