3.6. Detecting the type of a BkFileBase

A BkFileBase has a member named posixFileMode. This member can be passed to one of the macros in this section to figure out whether it's a directory, a regular file, or a symbolic link. Examples are given to illustrate how to use the macros.

3.6.1. IS_DIR()

    if(IS_DIR(base->posixFileMode))
    {
        /* base is a directory, and can be cast to one */
    }

3.6.2. IS_REG_FILE()

    if(IS_REG_FILE(base->posixFileMode))
    {
        /* base is a regular file, and can be cast to one */
    }

3.6.3. IS_SYMLINK()

    if(IS_SYMLINK(base->posixFileMode))
    {
        /* base is a symbolic link, and can be cast to one */
    }