home *** CD-ROM | disk | FTP | other *** search
/ Programming Win32 Under the API / ProgrammingWin32UnderTheApiPatVillani.iso / Chapter9 / cmd32 / MKDIR.C < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-29  |  1.6 KB  |  61 lines

  1. /****************************************************************/
  2. /*                                */
  3. /*                 mkdir.c                */
  4. /*                                */
  5. /*            Copyright (c) 2000            */
  6. /*            Pasquale J. Villani            */
  7. /*            All Rights Reserved            */
  8. /*                                */
  9. /* This file is part of CMD32.                    */
  10. /*                                */
  11. /* CMD32 is free software; you can redistribute it and/or    */
  12. /* modify it under the terms of the GNU General Public License    */
  13. /* as published by the Free Software Foundation; either version    */
  14. /* 2, or (at your option) any later version.            */
  15. /*                                */
  16. /* CMD32 is distributed in the hope that it will be useful, but    */
  17. /* WITHOUT ANY WARRANTY; without even the implied warranty of    */
  18. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See    */
  19. /* the GNU General Public License for more details.        */
  20. /*                                */
  21. /* You should have received a copy of the GNU General Public    */
  22. /* License along with CMD32; see the file COPYING.  If not,    */
  23. /* write to the Free Software Foundation, 675 Mass Ave,        */
  24. /* Cambridge, MA 02139, USA.                    */
  25. /****************************************************************/
  26.  
  27. /* $Logfile$ */
  28.  
  29. /* $Log$ 
  30.  * $EndLog$ */
  31.  
  32. #ifdef VERSION_STRINGS
  33. static char *RcsId = "$Header$";
  34. #endif
  35.  
  36. #include <windows.h>
  37. #include "globals.h"
  38. #include "proto.h"
  39.  
  40. BOOL mkdir(INT argc, BYTE *argv[])
  41. {
  42.     /* Test the arguments                        */
  43.     if(argc != 2)
  44.     {
  45.         error_message(INV_NUM_PARAMS);
  46.         return FALSE;
  47.     }
  48.  
  49.     /* and create the directory                    */
  50.  
  51.     if(!CreateDirectory((LPCTSTR)argv[1], 0))
  52.     {
  53.         error_message(INV_DIR);
  54.         return FALSE;
  55.     }
  56.     else
  57.         return TRUE;
  58. }
  59.  
  60.  
  61.