Saturday, March 6, 2010

Copying files in binary mode

Long time guys.... Yes, m really writing after a long time..i guess after 2 months...
There hasn't been learning on my side on the technical front, but a lot on the domain side..
Copying files :
Many of us would be using tools like winscp, which uses SSH for transferring files between Linux and Windows..even I use it... SSH basically does encryption and decryption before sending and receiving data respectively.It does so for secure transmission.

Now when you copy files between Windows and Linux, you should preferably use bin or binary mode.
Now comes a big "WHY" ???
I prefer it because in "text" mode, WINSCP does some conversion between end of line characters (Windows uses CR+LF(\r\n) as EOL whereas Linux uses LF(\n))
CR and LF represents bytes used to denote EOL.
Enter key generates LF.
CR is denoted by \r.

So to avoid this conversion, its better to use bin mode when you copy dumps or some other type of files which dont deal with just characters.

Ill now come up wid details on these in my next post... Thanks...

3 comments:

  1. When copying from Windows to Linux or vice-versa, it should be done in "tar.gz" mode to keep the permissioning intact.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. very usefull! thanks

    ReplyDelete