Ticket #3234 (new defect)

Opened 10 years ago

Last modified 22 months ago

filehighlight doesn't work for hardlinks

Reported by: mc_user Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: 4.8.12
Keywords: Cc: devel.openSUSE.org@…, aros@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by andrew_b) (diff)

The support of hardlinks highlightning was added to mc's filehighlight according to changes log, but it doesn't work as expected.

Steps to reproduce:

  1. create a hardlink for file;
  2. ensure that skin <skin_name>.ini file contains:
        [filehighlight]
        hardlink = red;white
    
    and filehighlight.ini:
        [hardlink]
        type=HARDLINK
    
  3. look at a hardlink in a panel

Actual result:

  • no hardlink hightlight

Expected result:

  • working hightlightning for hardlinks

Change History

comment:1 Changed 10 years ago by mc_user

  • Cc devel.openSUSE.org@… added

comment:2 Changed 9 years ago by andrew_b

Ticket #3370 has been marked as a duplicate of this ticket.

comment:3 Changed 9 years ago by egmont

I never understood the concept of highlighting hardlinks.

It's an orthogonal property to the file type which is also highlighted. Which one should take precedence (see #3375) and why?

Just because there's a hardlink to a photo, why should it be highlighted differently from the other photos? Or just because the hardlinked file happens to be a photo, why should it be highlighted differently than the other hardlinked files? Obviously you can't have both.

Even the concept of having type=FILE_EXE, type=DEVICE, type=SYMLINK and then type=HARDLINK is conceptually wrong, again hardlink is orhtogonal to the others. Yes, you can have a hardlink on a device or on a symlink.

If mc can highlight on this property, why can't (or if can then why doesn't) it highlight on properties such as unusual dangerous permissions (writable by others), unexpected owner (different from containing directory), timestamps in the future, etc.?

Seriously, I'm wondering, what's the use case why you would want to highlight hard links? If I work with files (e.g. watch a movie), I care about the file types and highlighting movies with a certain color helps, but telling me that the file is accessible under multiple names doesn't help at all.

In the rare case when I'm interested in hard links, I can add this column to file listing, just as I can add more important properties like owner/group and permissions that are not shown by default either.

comment:4 Changed 3 years ago by andrew_b

Ticket #4237 has been marked as a duplicate of this ticket.

comment:5 follow-up: ↓ 7 Changed 3 years ago by birdie

  • Cc aros@… added

Commenting out the hardlink section in /etc/mc/filehighlight.ini fixes the issue.

#[hardlink]
#    type=HARDLINK
Last edited 3 years ago by andrew_b (previous) (diff)

comment:6 Changed 3 years ago by andrew_b

  • Description modified (diff)

comment:7 in reply to: ↑ 5 Changed 3 years ago by andrew_b

Replying to birdie:

Commenting out the hardlink section in /etc/mc/filehighlight.ini

JFYI: you can use ~/.config/mc/filehighlight.ini instead of modifying system-wide config file.

fixes the issue.

#[hardlink]
#    type=HARDLINK

This is fixed in #3375.

comment:8 Changed 22 months ago by lastique

I came here because I noticed that hardlinks were no longer highlighted by mc. #3375 lowered precedence of hardlink highlightling, which effectively disables it for any known file types. While I understand the reasoning behind the change (make highlighting more closely associated with the file contents and purpose), highlighting hardlinks is still useful for filesystem management. Besides, symlinks are still highlighted despite their target's contents or purpose.

I propose to change hardlink highlighting to add a special character at the left of the file name, similar to how it is done for symlinks and executable files. Further, you may want to demote symlink highlighting similar to hardlinks, if you want to be more consistent. But the added character will at least make it obvious that the file is a hardlink.

Note: See TracTickets for help on using tickets.