#include #include #include #ifdef TEST #include #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