Closed PeWu closed 4 years ago
I'm afraid Windows default shell doesn't expand wildcards. https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths
You can use a combination of -R
and --paths ...
or --names ...
to perform globbing with the builtin glob/regex support.
Could you fix the documentation and error message? The current error message is quite misleading.
The error message is created from the template: Failed to stat <path>: <reason>
The second part (reason) after the colon comes from the operating system. I can't fix it.
I can improve only the first part a bit. I guess "stat" is a Unix/Linux only thing.
What about Failed to read metadata of <path>: <reason>
?
I don't think changing wording would help much. I wouldn't have guessed that the program is trying to use '*' as a file name. And even if I realized what the program tried to do, I wouldn't know what to do about it.
You could do something like:
if path contains '*':
log warning 'It looks like your shell does not support expanding wildcards. Try using --paths or --names. See https://git.io/JJCLH for more information.'
I like your suggesion, although I can imagine the warning could be also wrong and misleading - there is no reliable way of determining if the given file system accepts (or any other character) as part of the path. E.g. on Linux is a perfectly valid character in a path. The tool does not know if the user wanted to treat as a wildcard, or maybe they wanted a literal .
I can also imagine the above code could raise the warning even under shells that do support wildcard expansion.
E.g. this is a valid command under bash:
fclones -R '*'
(search all contents in the directory named * )
Thanks :)
Running
fclones *
in Windows 10 results in an error (sorry for the error message in Polish ;-)Running
fclones . -R
works properly and also running under WSL works properly.