Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

See how I use comp to implement file conflict detection.

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Comp

1. What is it?

Comp is the abbreviation of compare.

two。 Features:

Official explanation: compare the contents of two files or sets of files

Personal understanding: the main function of comp is to compare whether the two files are exactly the same, that is, to check the integrity and correctness of the files. For example, I backed up a file, and after the backup, I can use COMP to determine whether the files before and after the backup are completely consistent to determine whether the backup is successful. Is through the small partner of SVN or GIT, if you have encountered file conflicts and viewed conflicting files, you can fully understand this command. This command is like a simple version of file conflict checking tool.

3. Parameter description:

Comp [data1] [data2] [/ D] [/ A] [/ L] [/ N=number] [/ C] [/ OFF[LINE]]

Data1 specifies the first file, which can take a path

Data2 formulates a second file with a path

/ D displays differences in decimal form

/ A displays the difference in the form of ASCII code

/ L displays different number of rows

/ N=number the first specified number of lines in each file

/ C ASCII letters are case-insensitive when comparing files

/ OFF do not skip files with offline property sets

4. Parameter thinking:

1. Files can be specified with a path, indicating that COMP can be used to compare files on the same drive or on different drives

2.According to D digtal, the bytecode of the difference between two files is expressed in decimal.

3.According to An ascii, the byte code of the difference between two files is represented by ASCII code.

4.Compact L also shows the number of lines in which the differential bytecode is located.

5. Add a number to the parameter, and specify the lines to be compared. For example, if I write: / nail1, only the bytecode of the first line will be compared. When the number of lines is specified, the detection of file size will be skipped.

6. When comparing the two files to be compared, it is not case-sensitive, that is, aura.

7./off this parameter indicates that when comparing, compare together with the offline part.

5. Question:

1. I found a problem in the comparison:

1. If the size of the two files is not the same, it will directly prompt the file size to be inconsistent and then stop the comparison.

two。 If two files are of the same size, the two files are compared byte by byte

two。 If you specify the number of lines to compare, it will not determine whether the two files are the same size and directly compare the corresponding number of lines.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report