1
1
openmpi/opal/util/os_create_dirpath.h
Brian Barrett 566a050c23 Next step in the project split, mainly source code re-arranging
- move files out of toplevel include/ and etc/, moving it into the
    sub-projects
  - rather than including config headers with <project>/include, 
    have them as <project>
  - require all headers to be included with a project prefix, with
    the exception of the config headers ({opal,orte,ompi}_config.h
    mpi.h, and mpif.h)

This commit was SVN r8985.
2006-02-12 01:33:29 +00:00

65 строки
2.5 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
* Creates a directory tree set to the specified permissions.
*
* The opal_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
* opal_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
* permissions. The function will return OPAL_ERROR if this cannot
* be done.
**/
#ifndef OPAL_OS_CREATE_DIRPATH_H
#define OPAL_OS_CREATE_DIRPATH_H
#include "opal_config.h"
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
/**
* @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.
* @retval OPAL_SUCCESS If the directory tree has been successfully created with
* the specified access permissions.
* @retval OPAL_ERROR If the directory tree could not be created with the
* specified access permissions.
*/
OMPI_DECLSPEC int opal_os_create_dirpath(const char *path, const mode_t mode);
#endif