Author Topic: (Visual) file comparison, aka Diff (Amsdos, CP/M, FutureOs, SymbOS, ...)  (Read 3121 times)

0 Members and 1 Guest are viewing this topic.

Offline madram

  • CPC664
  • ***
  • Posts: 68
  • Country: fr
  • Liked: 44
  • Likes Given: 21
Hi and hello,
I'm looking for any tools to compare 2 ascii files. Either giving a diff (best) and/or displaying them both on the screen.
Ok for displaying 2 files SymbOS should do the trick, but automatic comparison is what I'm longing for.


If I recall well, Promerge allows to open 2 files, but can they be compared ?








Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 493
  • Country: de
    • index.php?action=treasury
  • Liked: 244
  • Likes Given: 1243
Don't if it helps but Utopia can compare data in RAM and a file.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Offline Audronic

  • 6128 Plus
  • ******
  • Posts: 1.315
  • Country: au
  • I know RST3 . I now know a little More.
  • Liked: 290
  • Likes Given: 653
@madram
I bring the files to a MAC and use HexEdit.
I also use HexEdit to Edit Roms.
Ray
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 493
  • Country: de
    • index.php?action=treasury
  • Liked: 244
  • Likes Given: 1243
...of course NotePad+ on PC side has a good comparing tool.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Offline netmercer

  • CPC464
  • **
  • Posts: 47
  • Country: de
  • Liked: 43
  • Likes Given: 17
Hi,
there is a very useful tool under CP/M, which does this job. It's called "TCOMP.COM" (text compare) and is available from SIG-M disk no. 289 (COMPARE.LBR).

Kind regards
netmercer

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1978
  • Likes Given: 4650
Yes, there are few great tools for CP/M to compare files. Also there is the great ASCII tools for CPC under CP/M Plus.  :)




If you need a tool for FutureOS just let me know, then i will make one. You can use/compare as much files at the same time as you want.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline madram

  • CPC664
  • ***
  • Posts: 68
  • Country: fr
  • Liked: 44
  • Likes Given: 21
Thanks all!


@netmercer Which tool do you suggest to unpack LBR files?
@TFM That's quite vague! Mind to name a few?
@Audronic. There was a MACINTOSH emulator on the Atari ST, but nothing like that for CPC I guess.


Transfering files on another machine is not a serious solution!

Offline Audronic

  • 6128 Plus
  • ******
  • Posts: 1.315
  • Country: au
  • I know RST3 . I now know a little More.
  • Liked: 290
  • Likes Given: 653
@madram
Were there some older ROMS that had a range of tools in them.? ?
Ray

Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

Offline SRS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 581
  • Country: de
  • Schneider CPC464 - what else ?
  • Liked: 567
  • Likes Given: 311
« Last Edit: 13:36, 22 August 16 by SRS »

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1978
  • Likes Given: 4650
@TFM That's quite vague! Mind to name a few?


Wished I could, currently only my work pc runs, so I can't access my own stuff sadly. But you can check the public domain of CP/M in the internet, f.e. SIGM and ZCPR stuff included. It should be still out there.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline netmercer

  • CPC464
  • **
  • Posts: 47
  • Country: de
  • Liked: 43
  • Likes Given: 17
Hi,

there are several tools for managing libary files, for example the improved "NULU.COM".
I have attached the TCOMP.COM file as RAR for you.
Visit the great "www.gaby.de" homepage for a lot of CP/M stuff and links.


Transfering files on another machine is not a serious solution!


You are absolutely right.   :D

Kind regards
netmercer

Offline madram

  • CPC664
  • ***
  • Posts: 68
  • Country: fr
  • Liked: 44
  • Likes Given: 21
@TFM  In FutureOs, a visual diff (à la vim -d / meld / kdiff3 / beyond compare ...) would be terrific.

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1978
  • Likes Given: 4650
@TFM  In FutureOs, a visual diff (à la vim -d / meld / kdiff3 / beyond compare ...) would be terrific.


Sorry, got no idea about non-Z80 OS/computer. So what does a "vim -d / meld / kdiff3 / beyond compare" do? Or more easy what do you want it to do?
 :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline madram

  • CPC664
  • ***
  • Posts: 68
  • Country: fr
  • Liked: 44
  • Likes Given: 21
Visual "diff" allows to easily locate and monitor modifications/insertions/deletions between 2 files, with full context.

One image better than 52 words :



The visualization part is the most needed. In a second time, editing/merge facilities are very welcome.
A smart diff is complex thus/and fun to code, but it doesn't need to be very sophisticated as long as it is offered to manually align some parts (hints for "synchronization points").
 




Offline Prodatron

  • 6128 Plus
  • ******
  • Posts: 832
  • Country: de
  • Back on the Z80
    • index.php?action=treasury
    • SymbOS SYmbiosis Multitasking Based Operating System
  • Liked: 1059
  • Likes Given: 555
I never had a deeper look at these algorythms for file comparisons. It's quite a very interestic topic, and I really wonder what is the best methode for that.
The problem for 8bit machines might be the size of the "window" which can be used for the comparison.
E.g. if the part of the source code, which has been added to the new version, is too large, an limited 8bit machine could have some problems?
It was the same issue for decompression algorithms, and I was really glad, that the famouse deflate algorithm (ZIP, GZIP, PNG etc) only requires a 32K "window". But that might be not enough for some file comparisons?

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Offline Munchausen

  • 6128 Plus
  • ******
  • Posts: 776
  • Country: gb
  • Liked: 213
  • Likes Given: 215
I never had a deeper look at these algorythms for file comparisons. It's quite a very interestic topic, and I really wonder what is the best methode for that.
The problem for 8bit machines might be the size of the "window" which can be used for the comparison.
E.g. if the part of the source code, which has been added to the new version, is too large, an limited 8bit machine could have some problems?
It was the same issue for decompression algorithms, and I was really glad, that the famouse deflate algorithm (ZIP, GZIP, PNG etc) only requires a 32K "window". But that might be not enough for some file comparisons?

There are lots of papers on the topic (was researching them a while back for another task), you're looking at the line oriented longest common subsequence (LCS) problem, the classic (1985/86) algorithm is described in "An O(ND) difference algorithm and its variations" [1] but there will be lots of newer stuff as well.

[1] http://www.xmailserver.org/diff2.pdf

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1978
  • Likes Given: 4650
One image better than 52 words :
Indeed. That looks great! The idea with the arrows is nice, so you can transfer blocks from one to another file.
Now it would be fun to have that for more that two files, right? Looks like a fun project on CPC.  :)


There are lots of papers on the topic ...
The fun about it so do it without studying other ideas, but to invent a cool and quick algorithm by oneself - IMHO.  ;)
« Last Edit: 17:22, 25 August 16 by TFM »
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Prodatron

  • 6128 Plus
  • ******
  • Posts: 832
  • Country: de
  • Back on the Z80
    • index.php?action=treasury
    • SymbOS SYmbiosis Multitasking Based Operating System
  • Liked: 1059
  • Likes Given: 555
There are lots of papers on the topic (was researching them a while back for another task), you're looking at the line oriented longest common subsequence (LCS) problem, the classic (1985/86) algorithm is described in "An O(ND) difference algorithm and its variations" [1] but there will be lots of newer stuff as well.

[1] http://www.xmailserver.org/diff2.pdf
I already suspected, that this isn't a trivial one.
Here is an interesting Wikipedia article about it:
Longest common subsequence problem - Wikipedia, the free encyclopedia
which is mentioned in the diff article:
diff utility - Wikipedia, the free encyclopedia

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Offline madram

  • CPC664
  • ***
  • Posts: 68
  • Country: fr
  • Liked: 44
  • Likes Given: 21

Quote
For displaying 2 files SymbOS should do the trick.


Not quite!
  • Via 'type' command launched on two separate symshell, there is a bug: first window also display last opened file. This was quite disturbing at first! Also, it would be nice to have an option to display line number (at least with %P flag, it may display "lines 25-67. Press any key")
  • Notepad only handles ~14k, while my file are ~59k.
Quote
I have attached the TCOMP.COM file as RAR for you.


Thank you very much. TCOMP seems to do a pretty good diff job (mismatch vs insertion/deletion), but :
  • absence of context makes the analysis more difficult.
  • I've haven't found a way to automatically pause, and had to manually press CONTROL-S.
  • It leads to memory full ("Error 7. Free space exceeded" or something like that.)

Quote
The fun about it so do it without studying other ideas.

I tend to agree! The constraints on CPC are not quite the same. Prodatron is right, fixed window/look-ahead will limit the size of inserted blocs which can be detected as so. But once again, allowing manual synchronization points (which amounts to internally split files and compare each portion independently) can save the day (I sometimes wish I had them even with modern & sophisticated algorithms).

Quote
Now it would be fun to have that for more that two files, right?

A typical use case is to have one "base" file and two distinct evolutions of this file. Then, a forth window can be needed for the output file (merging the two evolutions)!
But a simple two-way visual diff would be a really good and useful start.   

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1978
  • Likes Given: 4650
Ah, that's actually a good idea (to make a new file out of some source files). Well, we may end up with an file comparing text editior. But why not?  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus