Copying files from UNIX server question

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Copying files from UNIX server question

Post by *Boofo »

Is there a way to set TC to save a file downloaded through FTP in the UNIX file format? It saves it to windows format now, but if I make a file in EditPlus with the UNIX format, it will stay the exact same size after I upload it. It doesn't do that with windows format. The file size is always smaller on the server after I upload a windows file to the unix server.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Set transfer mode to binary.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Sob wrote:Set transfer mode to binary.
Thank you, that did the trick. But I need to ask, will it cause any problems that I am not thinking of? I only want it to work on PHP and text files.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Probably not. Binary mode just transfers files as they are, while text mode converts line endings. No further difference. So in case you have file with Windows line endings, it will be transfered to server without changes. For web pages it doesn't matter, web server just sends them to client and does not care about the content. But if you write e.g. some shell script on Windows, forget to convert Windows line endings to Unix ones and upload it using binary mode, then the system won't like it much.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Ahh, okay. Then it would matter in s small number of cases. Thank you very much for the explanation.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

You may consider editing the line:

[General]
ASCII=

In your wcx_ftp.ini file - it determines which file types that should be treated as non-binary files in Automatic mode. Remove *.txt and .php form this line if you have them there.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Excellent, thanks! That is actually easier. Would it be OK to do XML in binary too or is that not a good thing to do?
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
ado
Senior Member
Senior Member
Posts: 445
Joined: 2003-02-18, 13:22 UTC
Location: Slovakia, Pezinok

Post by *ado »

sure, XML is binary fine too. I am actually transferring tons of files between Win/Solaris back and fort via TC build in FTP and I am using only and only binary mode. If I need to transfer shell script that requires unix delimiters, I am saving that file as an Unix file (in Textpad).
...in fact as far as I know windows native Notepad.exe is the only editor that cannot handle unix line delimiters correctly ;-)

ado
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

It would be wise to transfer htm and html files as text, though, wouldn't it?

What kind of shell scripts are you meaning? I guess I haven't done any of those yet.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
frenky
Senior Member
Senior Member
Posts: 250
Joined: 2005-07-30, 19:36 UTC

Post by *frenky »

It would be wise to transfer htm and html files as text, though, wouldn't it?
Unless the bandwidth is an issue, I would advise against ASCII mode transfer in general as it can introduce some problems that are sometimes hard to notice. Also, IMHO, this is a bad transfer option as you can not be sure that you have 1:1 copy... And sometimes, somewhere at some point you'll run into problems. I know I had, so I now only use binary, never ASCII.
Ambiguity succeeds where honesty dares not venture.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Won't html files get weird characters in them from binary transfer? Are there any files that are transferred safer as ASCII than binary? I just want to make sure I have all my bases covered.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

The translation done by text mode does not affect anything except line endings. Direction from Windows to Unix takes CR+LF and converts it to bare LF. And the other way does the opposite. For html files it makes no difference, browsers don't (and even can't) care about line endings, because they must support both. Unlike character sets, there's no attribute to specify what type of line endings html document uses.
The only weird character you could see is ^M if you open the file with Windows line endings in Midnight Commander's editor on Unix system (possibly in other editors too, but I usually only use the one in MC).
Personally I always use binary mode, because I don't like some FTP server messing with my files. I know best what kind of line endings I want. :)
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Thank, guys, for all the info. I have set the default mode to binary now and will leave it as such. I have learned a lot in this thread. ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
Post Reply