home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
c_spec
/
execute
/
cd.c
< prev
next >
Wrap
Text File
|
1986-02-20
|
436b
|
28 lines
#include <stdio.h>
main(argc, argv)
char **argv;
{
register char *name;
if( argc != 2 || *(name = *++argv) == '-' )
{
fprintf(stderr, "Usage: cd [X:][<directory name>]\n" );
exit( 1 );
}
if( *name && name[1] == ':' )
{
bdos( 0xe, toupper(*name) - 'A', 0);
name += 2;
}
if( *name && chdir( name ) < 0 )
{
fprintf(stderr, "cd: Can't find %s\n", name );
exit( 1 );
}
exit( 0 );
}