Mercurial > repos > yufei-luo > s_mart
comparison commons/core/utils/FileUtils.py @ 18:94ab73e8a190
Uploaded
| author | m-zytnicki |
|---|---|
| date | Mon, 29 Apr 2013 03:20:15 -0400 |
| parents | 769e306b7933 |
| children |
comparison
equal
deleted
inserted
replaced
| 17:b0e8584489e6 | 18:94ab73e8a190 |
|---|---|
| 85 def are2FilesIdentical( file1, file2 ): | 85 def are2FilesIdentical( file1, file2 ): |
| 86 tmpFile = "diff_%s_%s" % ( os.path.basename(file1), os.path.basename(file2) ) | 86 tmpFile = "diff_%s_%s" % ( os.path.basename(file1), os.path.basename(file2) ) |
| 87 cmd = "diff %s %s >> %s" % ( file1, file2, tmpFile ) | 87 cmd = "diff %s %s >> %s" % ( file1, file2, tmpFile ) |
| 88 returnStatus = os.system( cmd ) | 88 returnStatus = os.system( cmd ) |
| 89 if returnStatus != 0: | 89 if returnStatus != 0: |
| 90 msg = "ERROR: 'diff' returned '%i'" % ( returnStatus ) | 90 print "WARNING: 'diff' returned '%i'" % returnStatus |
| 91 sys.stderr.write( "%s\n" % msg ) | |
| 92 sys.stderr.flush() | |
| 93 os.remove( tmpFile ) | 91 os.remove( tmpFile ) |
| 94 return False | 92 return False |
| 95 if FileUtils.isEmpty( tmpFile ): | 93 if FileUtils.isEmpty( tmpFile ): |
| 96 os.remove( tmpFile ) | 94 os.remove( tmpFile ) |
| 97 return True | 95 return True |
