Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6816a624292d4896cb15f92d6d0f2dd > files > 127

bigloo-3.1b-5mdv2010.0.i586.rpm

/*=====================================================================*/
/*    serrano/prgm/project/bigloo/tutorial/makedir.c                   */
/*    -------------------------------------------------------------    */
/*    Author      :  Manuel Serrano                                    */
/*    Creation    :  Thu Aug 20 11:13:16 1998                          */
/*    Last change :  Thu Aug 20 16:38:31 1998 (serrano)                */
/*    -------------------------------------------------------------    */
/*    This file implements makedir a function that creates a           */
/*    directory.                                                       */
/*=====================================================================*/
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>

/*---------------------------------------------------------------------*/
/*    makedir ...                                                      */
/*---------------------------------------------------------------------*/
int makedir( const char *pathname ) {
   if( access( pathname, R_OK ) )
      return mkdir( pathname, 0777 );
   else
      return 0;
}