/[MITgcm]/mitgcm.org/devel/buildweb/code-browser/F90Mapper/makeOutputDirectories.c
ViewVC logotype

Annotation of /mitgcm.org/devel/buildweb/code-browser/F90Mapper/makeOutputDirectories.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri Sep 20 19:47:31 2002 UTC (22 years, 9 months ago) by adcroft
Branch point for: Import, MAIN
File MIME type: text/plain
Initial revision

1 adcroft 1.1 #include <stdio.h>
2     #include <errno.h>
3     #include <string.h>
4     #include "GLOBALS.h"
5    
6     int makeOutputDirectories(dName)
7     /* Create a directory for output if it soed not already exist */
8     char *dName;
9     {
10     int rc;
11     char dNamBuf[MAXPATHNAM];
12    
13     if ( strlen(dName) > MAXPATHNAM - strlen(VARSUF)-2 ){
14     return(-1);
15     }
16     rc = mkdir(dName, 0755);
17     if ( rc != 0 ){ if ( errno != EEXIST ) return(-1); }
18     rootDir = strdup(dName);
19     sprintf(dNamBuf,"%s/%s",dName,VARSUF);
20     rc = mkdir(dNamBuf, 0755);
21     if ( rc != 0 ){ if ( errno != EEXIST ) return(-1); }
22     varDir = strdup(dNamBuf);
23     sprintf(dNamBuf,"%s/%s",dName,SRCSUF);
24     rc = mkdir(dNamBuf, 0755);
25     if ( rc != 0 ){ if ( errno != EEXIST ) return(-1); }
26     srcDir = strdup(dNamBuf);
27    
28     return(0);
29     }

  ViewVC Help
Powered by ViewVC 1.1.22