home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / APIEXAM / NEWDIR.ADB < prev    next >
Text File  |  1995-11-04  |  853b  |  27 lines

  1. -- Create new subdirectory DosCreateDir API OS/2
  2. -- in the end of current directory on path
  3. with Ada.text_io; use Ada.text_io;
  4. with builtin; use builtin;
  5. with os2;use os2;
  6. with os2.fm;use os2.fm;
  7. with os2.err;use os2.err;
  8. procedure newdir is
  9. zero:constant character:=character'val(0);
  10. rc:apiret;
  11. l:natural;
  12. path         :string(1..60):=(others=>zero);
  13. ppath        :PSZ :=path(1)'address;
  14.  
  15. ------------------------------------------------------------------------
  16. begin
  17. put("Enter path or *.* => ");  get_line(path,l);
  18. rc:=DosCreateDir(pszDirName => ppath,op2  => Null );
  19.  
  20. if    rc=3 then put("path not found");
  21. elsif rc=5 then put("Can't make directory");
  22. elsif rc>0 then  put_edit("DosMkdir error=",integer(rc),4);
  23.     put("System Error=>"); put(Err_list(integer(rc)));
  24.             else put("All right");
  25. end if;
  26. end newdir;
  27.