1

I want to get the MD5 checksum of a file called 🔥.txt. This works fine in Cygwin:

$ md5sum 🔥.txt
d41d8cd98f00b204e9800998ecf8427e 🔥.txt
$ openssl dgst -md5 🔥.txt
MD5(🔥.txt)= d41d8cd98f00b204e9800998ecf8427e

But outside of it, I cannot:

$ md5sum 🔥.txt
md5sum: can't open '.\??.txt': Invalid argument
$ openssl dgst -md5 🔥.txt
.\??.txt: Invalid argument
6C2A0100:error:8000007B:system library:file_ctrl:no protocol option:crypto\bio\bss_file.c:297:calling fopen(.\??.txt, rb)
6C2A0100:error:10080002:BIO routines:file_ctrl:system lib:crypto\bio\bss_file.c:300:
$ busybox md5sum 🔥.txt
sum: can't open '.\??.txt': Invalid argument

I thought maybe I could use the 8.3 path name, but dir /-n shows that the 8.3 name has the emoji in it too.

I've been trying to find if there's some alternative to coreutils sum that might be able to handle this but I can't see anything. I can't find anything in the Windows documentation about converting the filenames into something readable, either.

And this is causing me a lot of headaches because rclone relies on md5sum working to transfer files, so right now I can't transfer any files to or from Windows machines.

What can I do?

1 Answer 1

2

Windows supports emoticons in files just fine. Do make sure you put the entire filename in quotes.

For example:

C:\temp\emoticon test>echo testing > "d41d8cd98f00b204e9800998ecf8427e 🔥.txt"

C:\temp\emoticon test>dir
 Volume in drive C has no label.
 Volume Serial Number is 1C0C-DB56

 Directory of C:\temp\emoticon test

22-06-2024  12:40    <DIR>          .
22-06-2024  12:40    <DIR>          ..
22-06-2024  12:40                 7 d41d8cd98f00b204e9800998ecf8427e 🔥.txt
               1 File(s)              7 bytes
               2 Dir(s)  114.800.906.240 bytes free

C:\temp\emoticon test>type "d41d8cd98f00b204e9800998ecf8427e 🔥.txt"
testing

C:\temp\emoticon test>

If the problem is with md5sum, consider renaming the file first, do md5sum, and then renaming it back.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .