ITADN

possibly dangerous behaviour of "-I"

#351Openxkcd386at 创建于 2026-06-25
X
xkcd386atcommented
[Edit 3 days later: changed subject line from "confusing" to "potentially dangerous"] Hi, I have a very confusing situation. I'm sure I'm missing/misunderstanding something, and need help. setup: $ mkdir fclones-test $ cd fclones-test $ mkdir 1 2 1 unique file each: $ echo apple > 1/a $ echo banana > 2/b 1 set of duplicate files *within* each directory: $ echo fruits | tee 1/f1 | tee 1/f2 $ echo vegetables | tee 2/v1 | tee 2/v2 Plain group: $ fclones group -s0 1 2 [...] [2026-06-25 06:12:49.438] fclones: info: Found 2 (18 B) redundant files 3912abff18c50ac6c875159a4eb5cf12, 11 B (11 B) * 2: /home/x3/fclones-test/2/v1 /home/x3/fclones-test/2/v2 6102df57fabc00d2a6be19c176b3e634, 7 B (7 B) * 2: /home/x3/fclones-test/1/f1 /home/x3/fclones-test/1/f2 No duplicates common to both directories, so `-I` should not print anything: $ fclones group -s0 -I 1 2 [...] [2026-06-25 06:12:55.154] fclones: info: Found 0 (0 B) redundant files So far, all good. But if I start from *within* a directory, and use a relative name for the other: $ cd 1 $ fclones group -s0 -I . ../2 [...] [2026-06-25 06:13:26.257] fclones: info: Found 2 (18 B) redundant files 3912abff18c50ac6c875159a4eb5cf12, 11 B (11 B) * 2: /home/x3/fclones-test/2/v1 /home/x3/fclones-test/2/v2 6102df57fabc00d2a6be19c176b3e634, 7 B (7 B) * 2: /home/x3/fclones-test/1/f1 /home/x3/fclones-test/1/f2 And instead of relative, I use an absolute directory for the other: $ fclones group -s0 -I . ~/fclones-test/2 [...] [2026-06-25 06:13:35.918] fclones: info: Found 1 (7 B) redundant files 6102df57fabc00d2a6be19c176b3e634, 7 B (7 B) * 2: /home/x3/fclones-test/1/f1 /home/x3/fclones-test/1/f2 I'm totally lost.
2 条评论