dcp: handle when destination exists of different type
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 200
- Forks
- 85
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 2
Description
dcp does not always correctly copying files into the destination if the destination exists but is a different type. AN EEXIST error is logged, but otherwise silently skipped.
For example:
dcp file dst
dcp dir dst // dst does not become a directory
We should either:
- Remove the destination before proceeding (or allow some options similar to
dsync). - Imitate the behavior of
cp - Propagate the error to the user.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented dcp file dst and dcp dir dst cases, then inspect how dcp handles the logged EEXIST condition and compare the related dsync behavior with cp. Clarify which of the three proposed outcomes is wanted before changing the implementation; done means a destination of a different type is handled explicitly rather than silently skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100