File compare locks files from external editor when not in edit mode

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
jrbrown00
Junior Member
Junior Member
Posts: 26
Joined: 2003-04-23, 15:49 UTC

File compare locks files from external editor when not in edit mode

Post by *jrbrown00 »

I have a problem that I think is new.
- I am using File Compare to compare two files.
- I am not in edit mode.
- Both files are open in Textpad and were open before I started file compare
- Textpad is configured not to lock files while editting, except when saving
If I try to save either of the files from Textpad while File Compare is open, I see a dialog box telling me "Encountered a sharing violation while accessing ...."

I'm not sure when this started, but I'm pretty sure it did not used to do this. Help?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6492
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: File compare locks files from external editor when not in edit mode

Post by *Horst.Epp »

No such problem here.
Tested with PSPad, SynWrite and AkelPad as editors.
The editor saves the changes and TC asks if it should be recompared.
So check the settings of your Editor or ask in their forum.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: File compare locks files from external editor when not in edit mode

Post by *petermad »

I compare files all the time that are open in my Metapad, Notepad or Notepad++, and TC just asks to recompare, when I save one of the files, just as Horst.Epp also describes.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: File compare locks files from external editor when not in edit mode

Post by *ghisler(Author) »

It depends on the size of the files you compare:
1. Small size are read into a memory buffer as a whole, and then compared. In this case, you can still edit the files externally.
2. Large files are opened (locked) and mapped into memory. This has the advantage that even huge files can be compared even if you have far less RAM than the size of the file.

Currently the limit is 1 MByte, but you can change it via wincmd.ini by adding a line under the [Configuration] section:
MaxCompareSizeInMem=1048576

1048576 is 1 MByte (1024*1024), just use a larger number there.
Author of Total Commander
https://www.ghisler.com
jrbrown00
Junior Member
Junior Member
Posts: 26
Joined: 2003-04-23, 15:49 UTC

Re: File compare locks files from external editor when not in edit mode

Post by *jrbrown00 »

It does seem to be the size issue. The file I have problems with is 1.4 meg. I will try updating wincmd.ini
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: File compare locks files from external editor when not in edit mode

Post by *ghisler(Author) »

Modern PCs have a lot of memory, so you can set this to a large value like 10 million bytes or even 100 million bytes without problems, e.g.
MaxCompareSizeInMem=10000000
Author of Total Commander
https://www.ghisler.com
Post Reply