home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxhll.zip / FILESYS.REX < prev    next >
OS/2 REXX Batch file  |  1993-12-01  |  1KB  |  45 lines

  1. /* #include <filesystem.rex> */
  2.  
  3.  
  4. CompareFileTimes: procedure
  5.    /**
  6.    ***  This returns a boolean that indicates if the datetime stamps from
  7.    ***  first file is older than the datetime stamp from the second file.
  8.    ***  the file formats are the syntax from the SysFileTree
  9.    **/
  10.  
  11.    parse arg Stamp.1, Stamp.2
  12.  
  13.    do i = 1 to 2
  14.       parse var Stamp.i mon '/' day '/' year hour ':' temp
  15.       parse var temp min 3 meridian
  16.       hour = right(hour,2,'0')
  17.       mon = right(mon,2,'0')
  18.       if hour = 12 then hour = 0
  19.       if meridian = 'p' then
  20.          hour = hour + 12
  21.       CompareStamp.i = year||mon||day||hour||min
  22.    end
  23.    select
  24.       when CompareStamp.1 < CompareStamp.2 then
  25.          return '<'
  26.       when CompareStamp.1 > CompareStamp.2 then
  27.          return '>'
  28.       otherwise
  29.          return '='
  30.    end /* select */
  31.    return '='
  32.  
  33.  
  34. QualifiedDirectory: procedure
  35.    /**
  36.    ***  This determines if the file passed is a directory
  37.    **/
  38.  
  39.    parse arg DirSpec
  40.  
  41.    Current = directory()           /* Save current directory */
  42.    NewDir  = directory(DirSpec)    /* Get the fully qualified name */
  43.    Current = directory(Current)    /* Restore directory */
  44.    return NewDir
  45.