file-comparison

filecmp.cmp() ignoring differing os.stat() signatures?

这一生的挚爱 提交于 2019-12-04 07:45:51
The Python 2 docs for filecmp() say: Unless shallow is given and is false, files with identical os.stat() signatures are taken to be equal. Which sounds like two files which are identical except for their os.stat() signature will be considered unequal, however this does not seem to be the case, as illustrated by running the following code snippet: import filecmp import os import shutil import time with open('test_file_1', 'w') as f: f.write('file contents') shutil.copy('test_file_1', 'test_file_2') time.sleep(5) # pause to get a different time-stamp os.utime('test_file_2', None) # change

Programmatical approach in Java for file comparison

江枫思渺然 提交于 2019-12-03 09:32:39
问题 What would be the best approach to compare two hexadecimal file signatures against each other for similarities. More specifically, what I would like to do is to take the hexadecimal representation of an .exe file and compare it against a series of virus signature. For this approach I plan to break the file (exe) hex representation into individual groups of N chars (ie. 10 hex chars) and do the same with the virus signature. I am aiming to perform some sort of heuristics and therefore

Tool to compare directories (Windows 7) [closed]

被刻印的时光 ゝ 提交于 2019-12-03 01:43:44
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Due to some SVN movement I got disconnected from SVN while I was in middle of a fairly large enhancement. Now I have my current

Programmatical approach in Java for file comparison

核能气质少年 提交于 2019-12-02 23:58:06
What would be the best approach to compare two hexadecimal file signatures against each other for similarities. More specifically, what I would like to do is to take the hexadecimal representation of an .exe file and compare it against a series of virus signature. For this approach I plan to break the file (exe) hex representation into individual groups of N chars (ie. 10 hex chars) and do the same with the virus signature. I am aiming to perform some sort of heuristics and therefore statistically check whether this exe file has X% of similarity against the known virus signature. The simplest

Comparing two files in linux terminal

做~自己de王妃 提交于 2019-11-29 19:13:15
There are two files called "a.txt" and "b.txt" both have a list of words. Now I want to check which words are extra in "a.txt" and are not in "b.txt" . I need a efficient algorithm as I need to compare two dictionaries. if you have vim installed,try this: vimdiff file1 file2 or vim -d file1 file2 you will find it fantastic. Sort them and use comm : comm -23 <(sort a.txt) <(sort b.txt) comm compares (sorted) input files and by default outputs three columns: lines that are unique to a, lines that are unique to b, and lines that are present in both. By specifying -1 , -2 and/or -3 you can