pixel / hexedit

View and edit files in hexadecimal or in ASCII
http://rigaux.org/hexedit.html
GNU General Public License v2.0
98 stars 41 forks source link

Suggestion: Read only flag #59

Open jamespharvey20 opened 2 years ago

jamespharvey20 commented 2 years ago

I needed to view my hard drive with hexedit. To modify the disk, I would need to intentionally/unintentionally make changes and then intentionally/unintentionally press F2 or Ctrl+W to save. Although hopefully this would never happen unintentionally, I would love to see a --readonly flag added to the program to be able to run hexedit as a viewer only without having any risk of modifying the file/device. Some other hex editors have the ability to start in read-only mode. (i.e. ncurses-hexedit).

I think this would be useful for files in addition to disks.

Alternatively, someone could do this if they only had read permission to the file/device, but in the case of editing a block device (at least on Arch which defaults to rw for owner and group and nothing for others) that would require changing the permissions of the block device which could have unintended side effects. Perhaps adding permissions for others to read the block device and then running hexedit as a user without being in the disk group wouldn't be too bad, especially because I believe the permissions reset on reboot, but I still think it would be worthwhile to add as an option.

prigaux commented 2 years ago

pull request accepted :+1: