home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (C) 1993 Marc Stern (internet: stern@mble.philips.be) */
-
- #include "tools.h"
- #include <string.h>
- #include <direct.h>
-
- /*
- * mkpath()
- *
- * Input: dir - the directory to be created
- *
- * Comments: creates destination directory
- */
-
- int mkpath(char *dir)
-
- { char *p;
-
- for ( p = dir; p = strchr(p, '\\'); *p++ = '\\' )
- {
- *p = '\0';
- mkdir( dir );
- }
-
- if ( mkdir(dir) == -1 ) return -1;
-
- return 0;
- }
-
-