From 0c7137ff9e9064e4e5cdde7647be49044b195d96 Mon Sep 17 00:00:00 2001 From: allen Date: Tue, 7 Sep 1999 09:42:38 +0000 Subject: Routine to create new directories CCTK_mkdir git-svn-id: http://svn.cactuscode.org/flesh/trunk@878 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/util/File.c | 35 +++++++++++++++++++++++++++++++++++ src/util/make.code.defn | 1 + 2 files changed, 36 insertions(+) create mode 100644 src/util/File.c (limited to 'src/util') diff --git a/src/util/File.c b/src/util/File.c new file mode 100644 index 00000000..8372bbd3 --- /dev/null +++ b/src/util/File.c @@ -0,0 +1,35 @@ + +#include "cctk.h" + + /*@@ + @file File.c + @date September 6th 1999 + @author File handling routines + @desc + Miscellaneuous routines. + @enddesc + @@*/ + +int CCTK_mkdir(char *dir) +{ + int retval; + char *command; + char *message; + + command = (char *)malloc(1024*sizeof(char)); + + sprintf(command, MKDIR MKDIRFLAGS " %s",dir); + + message = (char *)malloc(1024*sizeof(char)); + sprintf(message,"Creating directory: \"%s\"",command); + CCTK_Info("Cactus",message); + free(message); + + retval = system(command); + + free(command); + + return retval; + +} + diff --git a/src/util/make.code.defn b/src/util/make.code.defn index a11d4721..476e69eb 100644 --- a/src/util/make.code.defn +++ b/src/util/make.code.defn @@ -1,6 +1,7 @@ SRCS=\ BinaryTree.c\ CactusTimers.c\ +File.c\ ParseFile.c\ RegisterKeyedFunction.c\ StoreKeyedData.c\ -- cgit v1.2.3