Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fdupes: correct description of -rH to 'consider hardlinks' #13289

Merged
merged 1 commit into from
Jul 21, 2024

Conversation

daniel-birket
Copy link
Contributor

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page(s) have at most 8 examples.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The PR title conforms to the recommended templates.

This corrects the description of 'fdupes -rH', which causes fdupes to consider hardlinks as duplicates. fdupes is not designed to convert duplicate files to hardlinks as implied by the original description.

❯ fdupes --version
fdupes 2.3.2

❯ fdupes --help
Usage: fdupes [options] DIRECTORY...

 -r --recurse            for every directory given follow subdirectories
                         encountered within
 -R --recurse:           for each directory given after this option follow
                         subdirectories encountered within (note the ':' at the
                         end of the option, manpage for more details)
 -s --symlinks           follow symlinks
 -H --hardlinks          normally, when two or more files point to the same
                         disk area they are treated as non-duplicates; this
                         option will change this behavior

The pertinent code is:

file_t **checkmatch(filetree_t **root, filetree_t *checktree, file_t *file)
{
  int cmpresult;
  char *fullpath;

  if (ISFLAG(flags, F_CONSIDERHARDLINKS))
  {
    /* If node already contains file, we don't want to add it again.
    */
    if (has_same_file(checktree, file))
      return NULL;
  }
  else
  {
    /* If device and inode fields are equal one of the files is a
       hard link to the other or the files have been listed twice
       unintentionally. We don't want to flag these files as
       duplicates unless the user specifies otherwise.
    */
    if (is_hardlink(checktree, file))
      return NULL;
  }

@CLAassistant
Copy link

CLAassistant commented Jul 21, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the page edit Changes to an existing page(s). label Jul 21, 2024
@acuteenvy acuteenvy changed the title Correct description of fdupes -rH to 'consider hardlinks' fdupes: correct description of -rH to 'consider hardlinks' Jul 21, 2024
@spageektti
Copy link
Member

LGTM, thanks for your contribution.

@spageektti spageektti merged commit 9225f1f into tldr-pages:main Jul 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
page edit Changes to an existing page(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants