Ignore:
Timestamp:
Oct 22, 2007 3:03:58 PM (13 years ago)
Author:
stefan
Message:

use stat to check file dates instead of ls --fulltime and regex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBosCommand.py

    r657 r663  
    2323      # running on posix so should be able to use ls command
    2424      if not os.path.isfile(target) : return True
    25       lsSource=run("ls --full-time "+source)
    26       lsTarget=run("ls --full-time "+target)
     25      statsource = os.stat(source)
     26      stattarget = os.stat(target)
     27      return statsource.st_mtime > stattarget.st_mtime
     28#      lsSource=run("ls --full-time "+source)
     29#      lsTarget=run("ls --full-time "+target)
    2730      #-rwxrwxrwx 1 jpf4 None 12309 2007-10-21 16:13:47.395793600 -0400 nightlyBuild.py
    28       rexBase=r"(-|r|w|x){10} . (.+) (.+) (.+) (\d\d\d\d-\d\d-\d\d .+) "
    29       rexSource=rexBase+source
    30       rexTarget=rexBase+target
    31       timeSource=(re.findall(rexSource,lsSource['stdout']))[0][4]
    32       timeTarget=(re.findall(rexTarget,lsTarget['stdout']))[0][4]
    33       return timeSource > timeTarget
     31#      rexBase=r"(-|r|w|x){10} . (.+) (.+) (.+) (\d\d\d\d-\d\d-\d\d .+) "
     32#      rexSource=rexBase+source
     33#      rexTarget=rexBase+target
     34#      timeSource=(re.findall(rexSource,lsSource['stdout']))[0][4]
     35#      timeTarget=(re.findall(rexTarget,lsTarget['stdout']))[0][4]
     36#      return timeSource > timeTarget
    3437     
    3538  else :
Note: See TracChangeset for help on using the changeset viewer.