home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------------- */
- /* home.c */
- /* macht das Stammverzeichnis zum aktuellen */
- /* Verzeichnis */
- /* ------------------------------------------------- */
-
- #include <stdio.h>
- #include <dos.h>
-
- char *getenv( char *);
-
- main()
- {
- char *home,temp;
- union REGS reg;
-
- if((home = getenv("HOME")) != NULL )
- {
- temp = (*home | 0x20) - 97;
- reg.h.ah = 0x0e; /* set drive */
- reg.h.dl = temp;
- intdos( ®,® );
- if( chdir(home) == -1 )
- {
- fprintf(stdout,"error: can't log to %s\n",home);
- exit(1);
- }
- }
- else
- fprintf(stdout,"not set\n");
- }
- /* ------------------------------------------------- */
- /* Ende von home.c */