2004-05-26 06:23:01 +04:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-05-27 20:26:36 +04:00
|
|
|
/** @file:
|
|
|
|
* Creates a directory tree set to the specified permissions.
|
|
|
|
*
|
|
|
|
* The ompi_os_create_dirpath() function creates a directory
|
|
|
|
* tree, with each directory that is created in the tree having the specified
|
|
|
|
* access permissions. Existing directories within the tree are left
|
|
|
|
* untouched - however, if they do not permit the user to create a directory
|
|
|
|
* within them, the function will return an error condition.
|
|
|
|
*
|
|
|
|
* If the specified full path name already exists, the
|
|
|
|
* ompi_os_create_dirpath() function will check to ensure that
|
|
|
|
* the final directory in the tree has at least the specified access permission. In other
|
|
|
|
* words, if the directory has read-write-execute for all, and the user
|
|
|
|
* has requested read-write access for just the user, then the function
|
|
|
|
* will consider the directory acceptable. If the minimal permissions are
|
|
|
|
* not currently provided, the function will attempt to change the
|
|
|
|
* access permissions of the directory to add the specified
|
2004-06-07 19:33:53 +04:00
|
|
|
* permissions. The function will return OMPI_ERROR if this cannot
|
2004-05-27 20:26:36 +04:00
|
|
|
* be done.
|
|
|
|
**/
|
2004-05-26 06:23:01 +04:00
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
#ifndef OMPI_OS_CREATE_DIRPATH_H
|
|
|
|
#define OMPI_SHOW_HELP_H
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2004-05-26 06:23:01 +04:00
|
|
|
#include <stdio.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-06-15 23:37:05 +04:00
|
|
|
#include <sys/types.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
2004-10-22 20:06:05 +04:00
|
|
|
#ifdef HAVE_SYS_STAT_H
|
2004-05-26 06:23:01 +04:00
|
|
|
#include <sys/stat.h>
|
2004-10-22 20:06:05 +04:00
|
|
|
#endif
|
2004-05-26 06:23:01 +04:00
|
|
|
|
2004-05-27 20:26:36 +04:00
|
|
|
/**
|
|
|
|
* @param path A pointer to a string that contains the path name to be built.
|
|
|
|
* @param mode A mode_t bit mask that specifies the access permissions for the
|
|
|
|
* directories being constructed.
|
2004-06-07 19:33:53 +04:00
|
|
|
* @retval OMPI_SUCCESS If the directory tree has been successfully created with
|
2004-05-27 20:26:36 +04:00
|
|
|
* the specified access permissions.
|
2004-06-07 19:33:53 +04:00
|
|
|
* @retval OMPI_ERROR If the directory tree could not be created with the
|
2004-05-27 20:26:36 +04:00
|
|
|
* specified access permissions.
|
|
|
|
*/
|
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC int ompi_os_create_dirpath(const char *path, const mode_t mode);
|
|
|
|
|
|
|
|
#endif
|