Specifying the same file for output multiple times in `find` will overwrite the file by default.

Open
#439 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start with the linked pull request discussion and reproduce find -fprint foo -fprint foo to observe the current behavior. Trace the handling of repeated output paths and compare it with the GNU find behavior described in the issue; done means both actions write to the same file without overlapping writes.

Written by the indexing model from the issue text.

Description

bug

refer: https://github.com/uutils/findutils/pull/421#discussion_r1705640231

For future reference: GNU find de-duplicates files, so if you do find -fprint foo -fprint foo it will use the same FILE * for both and you'll get each line twice. Right now uutils will use two different Files and the writes will overlap with each other.

Dominant language
Rust
Stars
649
Forks
101
Avg merge
2d 21h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/findutils

All issues in uutils/findutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.