• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Transfering files from Unix to Windows machine, problem with carriage returns

iluvdeal

Golden Member
I ftp to my school account to transfer files to and from my account their to my home machine. The school
machines are UNIX machines while I have a Windows PC at home. I use CuteFTP to transfer the files. When I
open up the text files are home all the lines have extra spaces between them.

Visual C++ gives me this message:

Line ending with only a carriage return have been detected. These will be modified to include a line feed.

The code still works, its just real ugly. BTW, if I copy the file to disk from school and open it at home, it doesn't have this problem. Does
anyone know of a way I can transfer the file by FTP without running into this problem? Thanks.
 
Did you make sure that you transferred in ASCII mode? I think that the ftp client will automatically process the file to remove the incorrect formatting if you transfer in ASCII mode (at least the Command Prompt ftp client does).
 
BINGO! Well sort of. CPP (C++ files) was under the file extension list for ASCII transfers in CuteFTP. I removed it and the file was formatted correctly when I opened it. I guess somehow downloading it in BINARY rather than ASCII fixed the problem.
 
As singh said, if you transfer in ASCII mode, the ftp protocol handles the newline conversion issue for you.

In binary mode, the file is transferred without any translation. So your experience is directly counter to standard behavior!
 
on UNIX (SunOS), there is a command called dos2unix and unix2dos
dos2unix will remove the ^M characters that windows use
unix2dos will add the ^M characters that windows use

i am assuming you are transferring from unix to windows?
that's quite strange, since it should actually "combine" the lines together (at least if you open them in notepad, not wordpad or vc++). maybe vc++ is the one who added the extra spaces?

and what manly said, the ascii transfer will add the carriage return/line feed character at the ends of line, while binary transfer will leave it as is... strange that cuteftp behaves the other way... 😕

<< BTW, if I copy the file to disk from school and open it at home, it doesn't have this problem. >>
do you mean you copy from a windows environment at school? or you put the disk in the solaris machine and access the floppy from there?

i'll rethink my typings again tomorrow ... right now my brain is somewhat dead, maybe i'm thinking the wrong things?

-956-
 
Back
Top