FTP : UNICODE.TXT is binary… !

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Parsing !

Post by *Clo »

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…

:mrgreen: M.f.G
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
3ICE
Junior Member
Junior Member
Posts: 22
Joined: 2013-04-09, 09:00 UTC
Location: Hungary
Contact:

Post by *3ICE »

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!

Code: Select all

If not textarea.empty
preventdefault & confirm("Are you sure you want to leave this page? Your post will be lost!") ...
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.
3ICE
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

3ICE,
Transfer in binary, make necessary line ending conversions later?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
3ICE
Junior Member
Junior Member
Posts: 22
Joined: 2013-04-09, 09:00 UTC
Location: Hungary
Contact:

Post by *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.
3ICE
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

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).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
Dalai
Power Member
Power Member
Posts: 9387
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

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
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

Dalai wrote:Text transfer mode is pretty much useless today since every decent editor supports all line endings.
Not quite. If you upload a script with CR+LF line ending it might not start. First line usually specifies the interpreter, e.g.

Code: Select all

#!/bin/bash
So shell will look for /bin/bash<CR>, will fail to find this file and refuse to run the script. A very confusing problem, hard to understand what's wrong.

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
User avatar
Dalai
Power Member
Power Member
Posts: 9387
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Flint:
I implied that the correct line ending for the target platform is already in the file.
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.
Exactly. I do it the same way.

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
Post Reply