Esempio n. 1
0
 /* CreateDir
 *  create a sub-directory
 *
 *  "access" [ IN ] - standard Unix directory mode, e.g.0775
 *
 *  "mode" [ IN ] - a creation mode ( see explanation above ).
 *
 *  "path" [ IN ] - NUL terminated string in directory-native
 *  character set denoting target directory
 */
 inline rc_t CreateDir ( uint32_t access, KCreateMode mode,
    const char *path, ... ) throw ()
 {
    va_list args;
    va_start ( args, path );
    rc_t rc = KDirectoryVCreateDir ( this, access, mode, path, args );
    va_end ( args );
    return rc;
 }
Esempio n. 2
0
static
rc_t open_out_dir (const char * path, KDirectory ** dir)
{
    rc_t rc;
    KCreateMode mode;

    rc = 0;
    mode = force ? kcmParents|kcmInit : kcmParents|kcmCreate;
    STSMSG (1, ("Creating %s\n", path));
    rc = KDirectoryVCreateDir (kdir, 0777, mode, path, NULL);
    if (rc != 0)
    {
        PLOGERR (klogFatal, (klogFatal, rc, "failure to create or clear output directory $(D)", PLOG_S(D), path));
    }
    else
    {
        rc = KDirectoryVOpenDirUpdate (kdir, dir, false, path, NULL);
        if (rc != 0)
        {
            PLOGERR (klogFatal, (klogFatal, rc, "failure to open output directory $(D)", PLOG_S(D), path));
        }
    }
    return rc;
}
Esempio n. 3
0
 inline rc_t CreateDir ( uint32_t access, KCreateMode mode,
    const char *path, va_list args ) throw ()
 { return  KDirectoryVCreateDir ( this, access, mode, path, args ); }