home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / visionix / test / tcopy.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-03-22  |  5.0 KB  |  125 lines

  1. Program TCOPY;  { Test program for VCOPY }
  2.  
  3. Uses
  4.  
  5.   CRT,
  6.   Dos,
  7.   VCopy,
  8.   VGen;
  9.  
  10. Var
  11.  
  12.   Err      : Integer;  { error code }
  13.   PathFrom : PathStr;
  14.   PathTo   : PathStr;
  15.   Params   : STRING;
  16.  
  17. {────────────────────────────────────────────────────────────────────────────}
  18.  
  19. Procedure CheckScrolling;
  20.  
  21. Const
  22.  
  23.   PauseStr = 'Press any key to continue ...';
  24.  
  25. Var
  26.  
  27.   Ch       : CHAR;
  28.   L1       : BYTE;
  29.  
  30. BEGIN
  31.  
  32.   If (LastMode DIV Font8x8 = 0) Then
  33.   BEGIN
  34.  
  35.     Write(PauseStr);
  36.     Ch := ReadKey;
  37.     For L1 := 1 to Length(PauseStr) Do
  38.       Write(#8+#32+#8);
  39.  
  40.   END;
  41.  
  42. END;
  43.  
  44. {────────────────────────────────────────────────────────────────────────────}
  45. {────────────────────────────────────────────────────────────────────────────}
  46. {────────────────────────────────────────────────────────────────────────────}
  47.  
  48. BEGIN
  49.  
  50.   {--------------------------}
  51.   { Redirect to standard I/O }
  52.   {--------------------------}
  53.  
  54.   Assign(Input, '');
  55.   Reset(Input);
  56.   Assign(Output, '');
  57.   ReWrite(Output);
  58.  
  59.   {--------------------------}
  60.   { Get paths and parameters }
  61.   {--------------------------}
  62.  
  63.   PathFrom := ParamStr(1);
  64.   PathTo   := ParamStr(2);
  65.   Params   := ParamStr(3);
  66.  
  67.   If (PathFrom = '') OR (PathTo = '') Then
  68.   BEGIN
  69.  
  70.     WriteLn('TCOPY 1.0 - test program for the Visionix VCOPY unit.                       ');
  71.     WriteLn('                                                                             ');
  72.     WriteLn(' Usage : [@][d:][path]sourcename [d:][path]targetname [param1,param2...]     ');
  73.     WriteLn(' Parameters (comma delimited, no spaces) :                                   ');
  74.     WriteLn(' ──────────────────────────────────────────────────────────────────────────  ');
  75.     WriteLn('  MOVE             Move instead of copy.                                     ');
  76.     WriteLn('  NOOVERWRITE      Do not overwrite duplicate target file.                   ');
  77.     WriteLn('  SUBDIR           Copy subdirectories                                       ');
  78.     WriteLn('  SHOW=FADTPS      Show each file''s general info:                           ');
  79.     WriteLn('                     Filename, Attributes, Date, Time, Packed-date, or Size. ');
  80.     WriteLn('  ATTR=ASHR        Search mask for source attributes types:                  ');
  81.     WriteLn('                     Archive, System, Hidden, and Readonly.                  ');
  82.     WriteLn('  EXACTATTR        Each found source file needs to be exactly the above      ');
  83.     WriteLn('                     attribute mask in order to be copied.                   ');
  84.     WriteLn('  NEWER            Copy only if target doesn''t exist or source is newer     ');
  85.     WriteLn('  SHARE            Use file-sharing/locking for copy                         ');
  86.     WriteLn('  TIMEOUT=SSS      Timeout for events (like SHARE).  Default = 30 seconds    ');
  87.     WriteLn('  APPEND           Append source file(s) to a single target file             ');
  88.     WriteLn('  DATE=MM-DD-YY    Copy file(s) ON this date                                 ');
  89.     WriteLn('  DATEB=MM-DD-YY   Copy file(s) BEFORE this date                             ');
  90.     WriteLn('  DATEA=MM-DD-YY   Copy file(s) AFTER this date                              ');
  91.     WriteLn('  DATEOB=MM-DD-YY  Copy file(s) ON or BEFORE this date                       ');
  92.     WriteLn('  DATEOA=MM-DD-YY  Copy file(s) ON or AFTER this date                        ');
  93.     WriteLn('  TIME=HH:MM       Copy file(s) AT this time                                 ');
  94.  
  95.     CheckScrolling;
  96.  
  97.     WriteLn('  TIMEB=HH:MM      Copy file(s) BEFORE this time                             ');
  98.     WriteLn('  TIMEA=HH:MM      Copy file(s) AFTER this time                              ');
  99.     WriteLn('  TIMEOB=HH:MM     Copy file(s) AT or BEFORE this time                       ');
  100.     WriteLn('  TIMEOA=HH:MM     Copy file(s) AT or AFTER this time                        ');
  101.     WriteLn('  MAKETARGETDIR    Create the target directory if it does not exist.         ');
  102.     WriteLn('                     Otherwise, targetname will be thought as the target     ');
  103.     WriteLn('                     filename mask.                                          ');
  104.     WriteLn('  TARGETDIRONLY    Do not create target subdirectories to match source       ');
  105.     WriteLn('                     subdirectories; instead, copy all source filespecs      ');
  106.     WriteLn('                     only to the main target directory.                      ');
  107.     WriteLn('  TESTMODE         Do everything as usual except the actual copying.         ');
  108.     WriteLn('                                                                             ');
  109.     WriteLn(' ListFile Usage (for each line):                                             ');
  110.     WriteLn('  [d:][path]sourcename [[d:][path]targetname] [/param1,param2...]            ');
  111.     WriteLn(' ──────────────────────────────────────────────────────────────────────────  ');
  112.  
  113.     Halt(1);
  114.  
  115.   END;
  116.  
  117.   Err := VCopyFile( ParamStr(1),
  118.                     ParamStr(2),
  119.                     ParamStr(3) );
  120.  
  121.   Halt(Err);
  122.  
  123. END.
  124.  
  125.