Page 1 of 1

Fixed: HxD: files opened "read only" require write

Posted: 07 Jul 2006 15:56
by mhurley
If you open a file with the "read only" checkbox checked in the open file dialog, my application, which uses GENERIC_READ access and FILE_SHARE_READ sharing, cannot get a handle to the same file.

If in my application I open the file with FILE_SHARE_READ|FILE_SHARE_WRITE I can get a handle.

I would expect HxD to not need write access if the read only checkbox is checked when selecting the file to open.

Posted: 08 Jul 2006 15:47
by Maël
Yes, that is too restrictive, these rights aren't necessary.

I uploaded a fixed version. It is in German as it is my development version, but should be enough to confirm if it works.

see here: http://mh-nexus.de/downloads/HxD.zip

Posted: 10 Jul 2006 19:24
by mhurley
The dev version you posted appears to fix the problem.

Posted: 04 Apr 2007 14:11
by Maël
Fixed in the actual beta version (see download section)

Posted: 05 Nov 2007 08:31
by xnifle
Is it fixed really? I've opened a text file on notepad and hxd for writing test, I cannot save the file on notepad. 1.7.1.0 beta version used.

Posted: 05 Nov 2007 13:55
by Maël
xnifle wrote:Is it fixed really? I've opened a text file on notepad and hxd for writing test, I cannot save the file on notepad. 1.7.1.0 beta version used.
Some applications recreate the file instead of just writing it which will not work as HxD keeps it open, also in readonly-mode. The intended fix was to allow writing but not creating a file (so technically it is fixed since the current version does not prohibit writes just recreating files).

But I have implemented a file locking mechanism in my current development version that only locks a file after you made the first change to a file in HxD, after saving this lock is released (this involved quite some changes as many parts of HxD relied on keeping the file open, which is why I didn't opt for this solution right from the start).

So if you haven't changed a file loaded in HxD or saved the changes, you will be able to modify/recreate the file outside of HxD.
This will be available in the 1.7.2 stable, the latest on end of December or begin of January.

Posted: 06 Nov 2007 05:45
by xnifle
cool! it'll be helped! thanks!

Posted: 16 Apr 2008 14:51
by Maël
The new version 1.7.6 implements a more relaxed file sharing. (Details at http://mh-nexus.de/hxd/#whatsnew)