home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / LEXMPSRC.RAR / DIRS.PAS < prev    next >
Pascal/Delphi Source File  |  2000-08-15  |  1KB  |  57 lines

  1. {█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
  2. {█                                                       █}
  3. {█      Virtual Pascal for Linux                         █}
  4. {█      Test example for directory functions             █}
  5. {█      ─────────────────────────────────────────────────█}
  6. {█      Copyright (C) 1999 Joerg Pleumann                █}
  7. {█                                                       █}
  8. {▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  9.  
  10. program Dirs;
  11.  
  12. uses
  13.   Dos;
  14.  
  15. var
  16.   S: string;
  17.  
  18. begin
  19.   FileSystem := fsDos;
  20.  
  21.   GetDir(0, S);
  22.   WriteLn('Current directory is "', S, '".');
  23.  
  24.   WriteLn('Creating dir "Outer"...');
  25.   MkDir('Outer');
  26.   WriteLn('Entering it...');
  27.   ChDir('Outer');
  28.  
  29.   GetDir(0, S);
  30.   WriteLn('Current directory is "', S, '".');
  31.  
  32.   WriteLn('Creating dir "Inner"...');
  33.   MkDir('Inner');
  34.   WriteLn('Entering it...');
  35.   ChDir('Inner');
  36.  
  37.   GetDir(0, S);
  38.   WriteLn('Current directory is "', S, '".');
  39.  
  40.   WriteLn('Leaving and removing it...');
  41.   ChDir('..');
  42.   RmDir('Inner');
  43.  
  44.   GetDir(0, S);
  45.   WriteLn('Current directory is "', S, '".');
  46.  
  47.   WriteLn('Leaving and removing dir "Outer"...');
  48.   ChDir('..');
  49.   RmDir('Outer');
  50.  
  51.   GetDir(0, S);
  52.   WriteLn('Current directory is "', S, '".');
  53.  
  54.   WriteLn('Perfect! :-)');
  55. end.
  56.  
  57.