How to make sure after ftp the file size from windows to unix envt the same?

HI Experts,

I am doing production deployment so i ftp files from Windows NT/XP to unix environment .Assume there is no unix view.
Mainly i need to apply check sum during production migration like applying checksum to nt  and unix files to make sure  the size and i need to take screenshot also.
 if i am coping files from unix to unix i can use cksum.But if i ftp files from nt to unix i find differences in bytes.
Like i need to take checksum screenshot for NT as wellas Unix seperately.
Please help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vikraman_bAuthor Commented:
need to transfer in ascii format only.
for example
i got a file in ClearCase stream NT view say some.sql,some.ini like that, i need to transfer this files from nt to unix envt
so normally use
telnet tounix server
ftp the files under ascii mode and i do the transfer.
u cannot use binary mode,binary can be used only for jar file,etc.,
so after transfer i need to check the size in the nt view as well as unix view.
so i need to apply cksum
if it is unix view i manually copy the file and take the cksum for source and destination directory if it going to be nt and unix ,how will compare and take the scree shot for logging purppose.
You need to make sure that you ransfer the file in BINARY mode to ensure the file size unchange.

please have a look at these docs:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I'm slightly familar with ClearCase and with ClearCase views.

'u cannot use binary mode' - why? You CAN and it's the only correct way to transfer any file (even text file) and only then you will get correct checksums. If you are using CFLF as an EOL in Windows text files and wish LF in Unix, your source and destination files will different and chksum will not help.

About your question.

You can use ported 'chksum' utility on Wiindows. It's about 20K in size.

There are LOTS OF utils (incluting grep, chksum and many others) in one 3Mb zip here:

You may find them very useful (even sh.exe is included) in your Windows (Just unpack them and update to your PATH env)
They are natively ported, without CygWin.

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

(same as Nopius and yuzh already explained)

ascii mode is unreliable and causes strange side effects, as you identified yourself
If you know how your ftp client deals with ascii mode *and* you know the remote ftp server deals with ascii mode, then feel free to use it, but as a result you definitely get files which cannot be compared with checksums.

If you need to remove for example M$'s useless/stupid \r in text files, then use a reliable converter before or after transfering instead.
Or better use a reliable editor to create/change your text files inthe format you need them.

> u cannot use binary mode,binary can be used only for jar file,etc.,
You can use binary mode for everything, ftp does not know anything about the file content, nor does it look at file extentsions.

see also http:/Q_21793615.html
vikraman_bAuthor Commented:
Then how to eliminate that ^M  at the end.
Is it i need to run DostoUnix utiliity or is there any other reliable utility.
> or is there any other reliable utility.
unfortunately DostoUnix utility has various names: d2u, dos2unix, to_unix, dos2uc, dosread, fromdos, etc. etc.
I got sick of that and either use perl or vi or:
  tr -d '\015' <file

KISS - keep it simple stupid
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.