#include <libraries/dos.h>
#include <exec/memory.h>
#include <functions.h>

#ifdef TEST
#include <stdio.h>
#endif

#ifndef NULL
#define NULL 0L
#endif


/*--------------------------------------------------------------*/
/*	mkdir(name): make a directory with the given name.	*/
/*--------------------------------------------------------------*/

int mkdir( name )
char *name;
{
	register struct Lock *lock;

#ifdef TEST
	fprintf( stderr, "mkdir: %s\n", name );
#endif
	if ( *name == '\0' )
	   return 0;
	lock = CreateDir( name );
	if ( !lock )
	   return (int)IoErr();
	else 
	   UnLock( lock );
	return 0;
}

#ifdef TEST
main()
{
	char command[100];

	gets( command );
	fprintf( stderr, "%d\n", mkdir( command ));
}

#endif


