Page 1 of 1

Not a bug: STOP HxD from Auto-Reloading files

Posted: 30 Sep 2009 03:01
by hbr_in
When the file loaded in HxD is modified externally, HxD auto-reloads the file.
Instead of this, an option should be provided to whether HxD should auto-reload or ask the user about the actions.

Anyway, HxD is a wonderfull Hex Editor for me now.

TIA

regards
Gururaja

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 30 Sep 2009 18:55
by Maël
When the file loaded in HxD is modified externally, HxD auto-reloads the file.
Instead of this, an option should be provided to whether HxD should auto-reload or ask the user about the actions.
This is not possible. HxD can handle huge files, as such it never keeps them in memory entirely. So I don't think it makes sense to provide such an option, since only the cached part can be refreshed/reloaded, the non-cached parts are taken from the current file anyway.

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 01 Oct 2009 04:11
by hbr_in
Maël wrote: This is not possible. HxD can handle huge files, as such it never keeps them in memory entirely. So I don't think it makes sense to provide such an option, since only the cached part can be refreshed/reloaded, the non-cached parts are taken from the current file anyway.
But i am saying about the Part that is being displayed in the window, Cant HxD warn the user that the file has changed externally & the user needs to refresh the window. HxD is refreshing the window without user consent. Also the user wont be knowing where the data changed inside the editor window.

Cached or Non cached part. Cant HXD just Detect external changes/modifications & infor the user
regards
Gururaja

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 19 Oct 2009 01:30
by Maël
Cant HxD warn the user that the file has changed externally & the user needs to refresh the window.
Usually only the part you see in the window is cached, but not the rest (i.e. as soon as you start scrolling). So if HxD does not reload the file you would get a part from the old file (part stored in HxD's cache) and the rest from the new file. I think it is confusing, even more so since you cannot identify what is new and what not, only what is cached and what isn't. I.e. some parts of the cache might match the current contents of the file, some might not.

I could make a notification that the file was reloaded, though.
Cached or Non cached part. Cant HXD just Detect external changes/modifications & infor the user
I you mean detecting what was changed, then I'm afraid that's not possible (at least not efficiently). It would require to keep a copy of the entire file somewhere so you don't depend on the current contents of the file (i.e. don't have to "reload"). However that would make handling of large files very slow since you have to read them entirely on the first opening.

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 19 Oct 2009 02:05
by hbr_in
Hi,

I think i am not clear here. I am not asking/Want HxD to detect whats changed & (parse &) display it. .

At Present HxD knows that the file is changed externally & it reloads the cache. But instead of reloading, cant HxD show a dialog to user that the file is changed externally & whether he wants to reload. If yes, then reload the cache part. Else dont reload. This is what all other Text/Hex editor does.

Hope i am clear

TIA

Regards
Gururaja

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 19 Oct 2009 03:22
by Maël
hbr_in wrote:This is what all other Text/Hex editor does.
You are clear, but the text/hex-editors that do that don't support large files. I tried to explain why both features (large files and optional reloading) are mutually exclusive.
As I said it makes no sense to not reload the cache as it represents only a small portion of the file, the rest will come from the current file anyway as the rest isn't cached. Combining old and new parts just makes no sense.

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 19 Oct 2009 03:53
by hbr_in
Maël wrote:As I said it makes no sense to not reload the cache as it represents only a small portion of the file, the rest will come from the current file anyway as the rest isn't cached. Combining old and new parts just makes no sense.
Sorry but what i am not getting is,

1. IF its only a part of file that is cached & displayed, & if this part of the file is externally Modified, Hxd Reloads it automatically. Why Doesnt HxD asks the user whether he wants to reload the Cache, reload/rewrite the cache only if the user wants.

2. When HxD can auto-detect & auto-reload, why cant it ask the user whether he wants to reload the cache, not the file

TIA

Regards
Gururaja

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 19 Oct 2009 14:17
by Maël
hbr_in wrote: 2. When HxD can auto-detect & auto-reload, why cant it ask the user whether he wants to reload the cache, not the file
It could, but it wouldn't make much sense. For example: say the file contains the text "ABCDEFG". The cached part is "A". Now the file is externally modified to "ZABCDEFG", i.e. a "Z" is inserted in the front. If HxD doesn't reload the cache the user will see this: "AABCDEFG". What sense does it make to have this (it's neither the old nor the new file)?

Re: Not a bug: STOP HxD from Auto-Reloading files

Posted: 21 Oct 2009 17:55
by Maël
If you have a suggestion how to solve that, I'm all ears. The problem is that I didn't find a way how to do it.

Maybe if you tell me why you need that feature, I can find an alternative that is also useful.