FTP : UNICODE.TXT is binary… !
Moderators: white, Hacker, petermad, Stefan2
Parsing !
2ghisler(Author)
Good evening,
• In the case, the extension is not meaningful, so I meant that only the extension as criterion is insufficient.
- Of course, I can set a “fancy” extension for Unicode-text files I exchange with friends via small personal FTP servers, let's say something like *.tx8 - *.tx16 - *.tx32 or whatever in the same painting, and so I will not have any error message.
- But from ¦ to elsewhere, the issue remains : I can't remove the *.txt from the list since it's needed for real ANSI *.txt, while I can have Unicode files as *.txt too … There is no different extension as "standard" AFAIK, and this is the problem !
- A 7Zip language file is *.txt, but not ANSI, and just send one should bind to rename it at each end of the connection, that's time wasting…
- For instance, I can have too a bunch of archives to download, plus a "Readme.txt" file "as is";
whether that txt is Unicode —> Error message, useless in that case.
- Finally, maybe only for the *.txt, TC could look for a header¦marker in the file and continue as binary when there is some info showing Unicode…
M.f.G
Claude
Clo
Good evening,
• In the case, the extension is not meaningful, so I meant that only the extension as criterion is insufficient.
- Of course, I can set a “fancy” extension for Unicode-text files I exchange with friends via small personal FTP servers, let's say something like *.tx8 - *.tx16 - *.tx32 or whatever in the same painting, and so I will not have any error message.
- But from ¦ to elsewhere, the issue remains : I can't remove the *.txt from the list since it's needed for real ANSI *.txt, while I can have Unicode files as *.txt too … There is no different extension as "standard" AFAIK, and this is the problem !
- A 7Zip language file is *.txt, but not ANSI, and just send one should bind to rename it at each end of the connection, that's time wasting…
- For instance, I can have too a bunch of archives to download, plus a "Readme.txt" file "as is";
whether that txt is Unicode —> Error message, useless in that case.
- Finally, maybe only for the *.txt, TC could look for a header¦marker in the file and continue as binary when there is some info showing Unicode…
M.f.G
Claude
Clo
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
Yes, this is very annoying. I am copying 10000 files in automatic mode and it keeps asking me this same question over and over:
---------------------------
Total Commander
---------------------------
WARNING! You try to transfer a binary file in text mode!
The target file will probably be unusable! Abort transfer?
---------------------------
Yes No
---------------------------
(Small edit: And background transfer is paused until I notice and click No.)
Don't abort my transfer! Ever! And stop asking for every single file.
But don't damage my binary files either! You're a smart program, figure it out yourself. I trust you. Promise no complaints when it messes up with like a 1:10000 chance. Just temporarily switch the mode to binary for that one stupid fake text file. I can't do anything about it, it isn't my file. I'm just responsible for backing it up. And now my backups suck because the server damages binary files transferred in text mode. So please, avoid this for me, as cleverly as you can.
Why is there not a third button: "Auto" which transfers my binary *.txt files in binary mode? Lots of unicode files nowadays...
UPDATE: Why on earth do you WIPE my post-in-progress when I click the stupid "site uses cookies" mandatory (in EU) spam? It should NOT reload the page. And the reload should be prevented by the forum!Thankfully it only happens once. But still... I had a minor heart attack over losing my post.
Sorry for my angry style. Germans always appear angry to the uninitiated. And I'm not even German.
---------------------------
Total Commander
---------------------------
WARNING! You try to transfer a binary file in text mode!
The target file will probably be unusable! Abort transfer?
---------------------------
Yes No
---------------------------
(Small edit: And background transfer is paused until I notice and click No.)
Don't abort my transfer! Ever! And stop asking for every single file.
But don't damage my binary files either! You're a smart program, figure it out yourself. I trust you. Promise no complaints when it messes up with like a 1:10000 chance. Just temporarily switch the mode to binary for that one stupid fake text file. I can't do anything about it, it isn't my file. I'm just responsible for backing it up. And now my backups suck because the server damages binary files transferred in text mode. So please, avoid this for me, as cleverly as you can.
Why is there not a third button: "Auto" which transfers my binary *.txt files in binary mode? Lots of unicode files nowadays...
UPDATE: Why on earth do you WIPE my post-in-progress when I click the stupid "site uses cookies" mandatory (in EU) spam? It should NOT reload the page. And the reload should be prevented by the forum!
Code: Select all
If not textarea.empty
preventdefault & confirm("Are you sure you want to leave this page? Your post will be lost!") ...
Sorry for my angry style. Germans always appear angry to the uninitiated. And I'm not even German.
3ICE
Thanks for the recommendation. I'll try it tonight. How do we set that up? I'll probably find it in the settings somewhere. Although I wonder; Would it work for me? Here is my actual use case:
I'm copying mixed content in bulk. Basically ten years of misc. internet history, about 10 GB across 10k files. Pictures, videos, source code, executables, ebooks, pdf, zip, and of course unicode text files that are neither text (by their content — null bytes galore) nor binary (by their file extension — *.txt) so what can I do? I admit I'm not that familiar with the file transfer protocol. Would binary mode transfer the source files all right, for example? If yes, why do we even bother with auto mode. Binary for everything.
I cannot separate the two kinds of files by hand, there's lots of users with their own folders of mixed content. To me Automatic seems the most logical choice. Until of course it starts asking questions - But then it's no longer "Auto" is it.
Yes to All
Edit regarding the line ending conversions: Line endings being preserved between a linux-windows transfer is actually preferred, as I don't want to change the contents of the files at all. Some of my users prefer [LF], others [CR][LF], (and I've seen plain [CR] line endings in the wild). Wouldn't convert anything.
I'm copying mixed content in bulk. Basically ten years of misc. internet history, about 10 GB across 10k files. Pictures, videos, source code, executables, ebooks, pdf, zip, and of course unicode text files that are neither text (by their content — null bytes galore) nor binary (by their file extension — *.txt) so what can I do? I admit I'm not that familiar with the file transfer protocol. Would binary mode transfer the source files all right, for example? If yes, why do we even bother with auto mode. Binary for everything.
I cannot separate the two kinds of files by hand, there's lots of users with their own folders of mixed content. To me Automatic seems the most logical choice. Until of course it starts asking questions - But then it's no longer "Auto" is it.
Yes to All
Edit regarding the line ending conversions: Line endings being preserved between a linux-windows transfer is actually preferred, as I don't want to change the contents of the files at all. Some of my users prefer [LF], others [CR][LF], (and I've seen plain [CR] line endings in the wild). Wouldn't convert anything.
3ICE
3ICE
If you don't want any conversion, the binary mode works best for you. It won't touch the contents and won't show any warnings. Just select Binary in the FTP panel (it appears just above your file panels when you are connected to FTP).
If you don't want any conversion, the binary mode works best for you. It won't touch the contents and won't show any warnings. Just select Binary in the FTP panel (it appears just above your file panels when you are connected to FTP).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
Binary mode doesn't touch any files while text mode changes line endings in text files (like .txt, .html, .sh, .cmd and so on). Text transfer mode is pretty much useless today since every decent editor supports all line endings. Text transfer mode probably exists because it wasn't as easy in the old days, so the files had to be converted during transfer.
I've never used Text transfer mode myself, except maybe for testing purposes. So, yes, Binary for everything and you don't need to worry about this topic again. Check the settings of your FTP connection, and maybe set it in Options > FTP > Default transfer mode.
Regards
Dalai
I've never used Text transfer mode myself, except maybe for testing purposes. So, yes, Binary for everything and you don't need to worry about this topic again. Check the settings of your FTP connection, and maybe set it in Options > FTP > Default transfer mode.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Not quite. If you upload a script with CR+LF line ending it might not start. First line usually specifies the interpreter, e.g.Dalai wrote:Text transfer mode is pretty much useless today since every decent editor supports all line endings.
Code: Select all
#!/bin/bash
But I prefer to have correct EOL type from the very beginning and use binary FTP mode, because files are not always uploaded via FTP. Sometimes it's SSH, sometimes it's SMB, etc. Better to make it right first time than to keep track of which protocol you are uploading the file with.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 10.52 / Win10 x64
Using TC 10.52 / Win10 x64
2Flint:
I implied that the correct line ending for the target platform is already in the file.
Regards
Dalai
I implied that the correct line ending for the target platform is already in the file.
Exactly. I do it the same way.Flint wrote:But I prefer to have correct EOL type from the very beginning and use binary FTP mode, because files are not always uploaded via FTP. Sometimes it's SSH, sometimes it's SMB, etc. Better to make it right first time than to keep track of which protocol you are uploading the file with.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror