![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-09 03:53 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Problem with Comparing Two Files |
| Printable Version 3,282 / 52 |
| Floor31 bat-zw | Posted 2008-07-09 23:19 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
Originally posted by quya at 2008-7-9 23:16: This is because the files after decompression were not deleted in time, resulting in the next decompression failing. Therefore, each time it is the same CRC32 for the file. ps: The problem with the code on floor 25 is still with expand. [ Last edited by zw19750516 on 2008-7-9 at 11:28 PM ] |
|
| Floor32 bat-zw | Posted 2008-07-09 23:24 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Please test my code on floor 28 and the modified code on floor 25.
[ Last edited by zw19750516 on 2008-7-9 at 11:25 PM ] |
|
| Floor33 quya | Posted 2008-07-09 23:31 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
|
After multiple tests again.
The following pattern is found: Under code page 936, it runs correctly. After running once, the code page becomes 437, and then the result is incorrect. There are many places that are incorrect, including those I mentioned above. Can someone analyze the reason and improve compatibility? I myself think this problem is too weird. |
|
| Floor34 quya | Posted 2008-07-09 23:32 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
Originally posted by zw19750516 at 2008-7-9 11:19 PM: No, expand overwrites the original file. It's a code page issue. |
|
| Floor35 bat-zw | Posted 2008-07-09 23:35 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Lao Tu tested the code in floors 25 and 28 that I modified? There's one that was just modified. Really, as one gets old, one is so careless and always makes mistakes.
|
|
| Floor36 quya | Posted 2008-07-09 23:42 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
Originally posted by zw19750516 at 2008-7-9 11:35 PM: The test on floor 28 was wrong just now. Now floor 25 is the same as floor 7, just don't know which one is more efficient. But it can only be correct under code page 936. It didn't work before under code page 437. So at the beginning of the batch line, we can only temporarily add CHCP 936 to ensure correct operation, because after using it once, it becomes 437. This crc32.com is good in other aspects, the most admired thing is that it is less than 1KB, but it will change the code page. You can't have both fish and bear's paws. |
|
| Floor37 bat-zw | Posted 2008-07-09 23:47 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
If the result at floor 25 is completely correct now, then it starts with the issue of expand. Initially, I copied your expand %%~fsi exactly, and now I have changed it to expand "%%i". I'll take a look at floor 28 again. As for efficiency, it's completely incomparable with floor 7 because floor 7 directly uses the generated crc.txt.
|
|
| Floor38 quya | Posted 2008-07-09 23:52 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
Originally posted by zw19750516 at 2008-7-9 11:47 PM: Floor 25, I ran it under code page 437 before. Later, I found the issue with the code page and re-run it. %%~fsi has absolutely better compatibility than %%i, which should not be doubted. The improved code in floor 7 is in floor 24. I think the code in floor 24 is more efficient because many variables are used to replace FOR and FINDSTR statements. |
|
| Floor39 bat-zw | Posted 2008-07-09 23:55 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Again:
|
|
| Floor40 bat-zw | Posted 2008-07-09 23:58 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
Originally posted by quya at 2008-7-9 23:52:Old man, did you carefully look at the code on floor 24? The whole thing is just a code to generate crc.txt, and it doesn't involve comparison at all! |
|
| Floor41 quya | Posted 2008-07-09 23:59 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
|
I have 5 command-line CRC check software, 2 are over 40K, 1 is 19K, 1 is 15K, and 1 is 1K.
Because the 1K program is used in pure DOS and has poor support in 32-bit environments, changing the code page, etc., so I have to use %%~fsi to get the path. At first I didn't want to use it, I wanted to use the 15K one, but the 15K program is extremely strange. I can't get the result when I do CRC32 >result.txt, it still displays on the screen, and using 1>result.txt doesn't work either. I wonder if you guys have encountered such a command-line program before? I'm just encountering it for the first time. |
|
| Floor42 quya | Posted 2008-07-10 00:01 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
Originally posted by zw19750516 at 2008-7-9 11:58 PM: This is his cleverness. Take another look, it's definitely running accurately. He uses not defined to detect variables. That is, a disguised comparison. The code on floor 39 still doesn't work, the same as floor 28, prompting that the command syntax is incorrect. [ Last edited by quya on 2008-7-10 at 12:04 AM ] |
|
| Floor43 bat-zw | Posted 2008-07-10 00:03 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Try crc32>result.txt, or else >result.txt crc32
|
|
| Floor44 quya | Posted 2008-07-10 00:08 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
Originally posted by zw19750516 at 2008-7-10 12:03 AM: Tried both, it's definitely an extremely strange program. If you don't believe it, go download it from my FTP://quya.2mydns.com/crc32.exe. Note that my computer is off and my FTP is also gone. [ Last edited by quya on 2008-7-10 at 12:09 AM ] |
|
| Floor45 bat-zw | Posted 2008-07-10 00:09 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
Originally posted by quya at 2008-7-12: Is there something wrong with my eyes? I've looked at the code on floor 24 many times, but I didn't see a single defined. Old-timer, can you take a look again? |
|
| Prev 1 2 3 4 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |