home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d109
/
uupc.lha
/
UUpc
/
Source
/
LOCAL
/
mkdir.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-10-28
|
727b
|
48 lines
#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