]> gitweb.factorcode.org Git - factor.git/commit
io.files.trash.windows: convert input path to absolute in send-to-trash
authorAlexander Iljin <ajsoft@yandex.ru>
Mon, 30 Jul 2018 07:21:25 +0000 (09:21 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Apr 2020 02:55:24 +0000 (02:55 +0000)
commita06e9cc3b20ef78af220b8d0cb2da9bea8d01963
tree59e24bfcbc15a33d6d65f67a9c2c07e3dc804fc3
parent595cf81eb8d7b04432f2fdf2709244aaa87449d6
io.files.trash.windows: convert input path to absolute in send-to-trash

The input path must be absolute, but normalize-path can't be used, because
that returns UNC path, and SHFileOperation fails on any path prefixed with
"\\?", see https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa
Use absolute-path instead. The mixture of slashes and backslashes in the
path is tolerated, at least on Windows 10.

Add a simple unit-test.
extra/io/files/trash/trash-tests.factor [new file with mode: 0644]
extra/io/files/trash/windows/windows.factor