rclone/fs/operations
nielash 7c6f0cc455 operations: fix renaming a file on macOS
Before this change, a file would sometimes be silently deleted instead of
renamed on macOS, due to its unique handling of unicode normalization. Rclone
already had a SameObject check in place for case insensitivity before deleting
the source (for example if "hello.txt" was renamed to "HELLO.txt"), but had no
such check for unicode normalization. After this change, the delete is skipped
on macOS if the src and dst filenames normalize to the same NFC string.

Example of the previous behavior:

 ~ % rclone touch /Users/nielash/rename_test/ö
 ~ % rclone lsl /Users/nielash/rename_test/ö
        0 2023-11-21 17:28:06.170486000 ö
 ~ % rclone moveto /Users/nielash/rename_test/ö /Users/nielash/rename_test/ö -vv
2023/11/21 17:28:51 DEBUG : rclone: Version "v1.64.0" starting with parameters ["rclone" "moveto" "/Users/nielash/rename_test/ö" "/Users/nielash/rename_test/ö" "-vv"]
2023/11/21 17:28:51 DEBUG : Creating backend with remote "/Users/nielash/rename_test/ö"
2023/11/21 17:28:51 DEBUG : Using config file from "/Users/nielash/.config/rclone/rclone.conf"
2023/11/21 17:28:51 DEBUG : fs cache: adding new entry for parent of "/Users/nielash/rename_test/ö", "/Users/nielash/rename_test"
2023/11/21 17:28:51 DEBUG : Creating backend with remote "/Users/nielash/rename_test/"
2023/11/21 17:28:51 DEBUG : fs cache: renaming cache item "/Users/nielash/rename_test/" to be canonical "/Users/nielash/rename_test"
2023/11/21 17:28:51 DEBUG : ö: Size and modification time the same (differ by 0s, within tolerance 1ns)
2023/11/21 17:28:51 DEBUG : ö: Unchanged skipping
2023/11/21 17:28:51 INFO  : ö: Deleted
2023/11/21 17:28:51 INFO  :
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Checks:                 1 / 1, 100%
Deleted:                1 (files), 0 (dirs)
Elapsed time:         0.0s

2023/11/21 17:28:51 DEBUG : 5 go routines active
 ~ % rclone lsl /Users/nielash/rename_test/
 ~ %
2024-01-20 14:50:08 -05:00
..
operationsflags sync: report list of synced paths to file -- see #7282 2024-01-20 14:50:08 -05:00
check.go operations: add logger to log list of sync results -- fixes #7282 2024-01-20 14:50:08 -05:00
check_test.go check: respect --no-unicode-normalization and --ignore-case-sync for --checkfile 2024-01-20 14:50:08 -05:00
copy.go operations: fix server side copies on partial upload backends after refactor 2023-10-30 16:50:19 +00:00
copy_test.go operations: fix invalid UTF-8 when truncating file names when not using --inplace 2023-10-29 14:04:37 +00:00
dedupe.go accounting: Make checkers show what they are doing 2023-03-01 11:10:38 +00:00
dedupe_test.go test: replace defer cleanup with t.Cleanup 2022-12-09 14:38:05 +00:00
listdirsorted_test.go test: replace defer cleanup with t.Cleanup 2022-12-09 14:38:05 +00:00
logger.go sync: report list of synced paths to file -- see #7282 2024-01-20 14:50:08 -05:00
lsjson.go lsjson: make --stat more efficient 2023-04-28 14:31:05 +01:00
lsjson_test.go rc: fix operations/stat with trailing / 2023-03-22 16:22:45 +00:00
multithread.go operations: use built in io.OffsetWriter for go1.20 2024-01-15 16:22:07 +00:00
multithread_test.go operations: fix overwrite of destination when multi-thread transfer fails 2023-11-24 11:19:58 +00:00
operations.go operations: fix renaming a file on macOS 2024-01-20 14:50:08 -05:00
operations_internal_test.go fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
operations_test.go moveOrCopyFile: avoid panic on --dry-run 2024-01-20 14:50:08 -05:00
rc.go operations: add operations/check to the rc API 2023-10-04 17:52:57 +01:00
rc_test.go operations: add operations/check to the rc API 2023-10-04 17:52:57 +01:00
reopen.go operations: make Open() return an io.ReadSeekCloser #7350 2023-11-20 18:07:05 +00:00
reopen_test.go operations: make Open() return an io.ReadSeekCloser #7350 2023-11-20 18:07:05 +00:00