home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume34 / fsp / part04 / fmkdir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-18  |  1.2 KB  |  48 lines

  1.     /*********************************************************************\
  2.     *  Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu)   *
  3.     *                                                                     *
  4.     *  You may copy or modify this file in any manner you wish, provided  *
  5.     *  that this notice is always included, and that you hold the author  *
  6.     *  harmless for any loss or damage resulting from the installation or *
  7.     *  use of this software.                                              *
  8.     \*********************************************************************/
  9.  
  10. #include "client_def.h"
  11.  
  12. extern char **glob(), *util_abs_path();
  13.  
  14. static make_dir(p)
  15.     char *p;
  16. {
  17.     char *op;
  18.     UBUF *ub;
  19.  
  20.     op = util_abs_path(p);
  21.  
  22.     ub = client_interact(CC_MAKE_DIR,0L, strlen(op),op+1, 0,NULLP);
  23.  
  24.     if(ub->cmd == CC_ERR)
  25.     {
  26.     fprintf(stderr,"Can't create %s: %s\n",p,ub->buf);
  27.     free(op); return(-1);
  28.     }
  29.  
  30.     printf("%s\t: %s\n",p,ub->buf);
  31.  
  32.     free(op);
  33.     return(0);
  34. }
  35.  
  36. main(argc,argv,envp)
  37.     int argc;
  38.     char **argv,**envp;
  39. {
  40.     char **av, *av2[2];
  41.  
  42.     env_client();
  43.     while(*++argv) make_dir(*argv);
  44.     client_done();
  45.  
  46.     exit(0);
  47. }
  48.