home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
dirmake.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-21
|
957b
|
50 lines
/*********
* DIRMAKE
*
* by Leonard Zerman
*
* Placed in the public domain by Tom Rettig Associates, 10/22/1990.
*
* Syntax: DIRMAKE( <expC> )
* Return: Logical .T. if successful else .F.
* Note : .T. IF the directory already exists.
*********/
#include <trlib.h>
static char path[67];
char *get_dir();
TRTYPE dirmake()
{
char *dirptr;
int status;
if(PCOUNT == 1 && ISCHAR(1))
{
dirptr = _parc(1);
status = get_drive();
status += 'A';
path[0] = (char)status;
path[1] = ':';
_tr_strcpy(path+2,get_dir());
status = set_dir(dirptr);
if (status == ERRORNEG)
{
status = _tr_mkdir(dirptr);
if (status == ERRORNEG)
_retl(FALSE);
else
_retl(TRUE);
}
else
{
set_dir(path);
_retl(TRUE);
}
}
else
_retl(FALSE);
}