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

Bug reports concerning HxD.
Post Reply
mhurley
Posts: 15
Joined: 28 Jun 2006 04:14

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

Post 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.
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Post 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
mhurley
Posts: 15
Joined: 28 Jun 2006 04:14

Post by mhurley »

The dev version you posted appears to fix the problem.
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Post by Maël »

Fixed in the actual beta version (see download section)
xnifle
Posts: 2
Joined: 05 Nov 2007 08:25

Post 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.
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Post 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.
xnifle
Posts: 2
Joined: 05 Nov 2007 08:25

Post by xnifle »

cool! it'll be helped! thanks!
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Post by Maël »

The new version 1.7.6 implements a more relaxed file sharing. (Details at http://mh-nexus.de/hxd/#whatsnew)
Post Reply