Closed Thread Icon

Preserved Topic: extra hard returns in code after FTP transfer? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17296" title="Pages that link to Preserved Topic: extra hard returns in code after FTP transfer? (Page 1 of 1)" rel="nofollow" >Preserved Topic: extra hard returns in code after FTP transfer? <span class="small">(Page 1 of 1)</span>\

 
JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 11-06-2002 03:35

This is driving me absolutely insane, I want to choke someone or something.

Sometimes when I transfer files via FTP then open them in my editor there's extra spaces, returns, in between the lines of code.

It apparently has nothing to do with binary or ASCII transfer modes and I can't really pattern it. I just took a .TPL file extension and transferred it (downloaded) via ASCII, then Binary with the same result.

I'm using wsFTP Pro 6.70. I have it configured to transfer all the weird file extensions I use according to their content, ASCII or Binary, and all the accounts are set to 'auto' to detect transfer method as I've specified for each file extension.

Anyone know what could be causing this? It's happened before but I suffered through it but I don't want to mess with it again, it's got me fuming.

thanks

Jason

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 11-06-2002 03:47

Do you always use the same text editor? I know mine converts text files to "DOS" mode but it asks first and I'm wondering if yours might do the same without a prompt and mucking up the conversion




.:[ Never resist a perfect moment ]:.

Big Cloud
Bipolar (III) Inmate

From: a little too close to NYC
Insane since: Oct 2002

posted posted 11-06-2002 04:00

I noticed a similar problems a while back with WSFTP (not sure what version). It would add random <CR><LF>'s to my HTML files. Never caused a problem. I've been using SmartFTP (http://www.smartftp.com) for a few months now and haven't seen anything like that. Hope that helps.




[This message has been edited by Big Cloud (edited 11-06-2002).]

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2002 04:20

This is very timely as I was just discussing this with Butcher (who I believe has been discussing it with you JK?). Sometimes some files (largely PHP or HTML) Steve sends me or uploads and I later grab collapse all the whitespace so the code is all on one line which isn't desirable and sometimes cause things to break.

I have been wondering what the problem could be and I thought it might be related to the text/code editor he is using on the Mac.

I was having trouble with a recent file and I got Butcher to look at it for me. He could open the file and saved it and uploaded it an lo and behold instead of the one line spacing in the code there were 5 or 6.

So all help on this would be appreciated from this direction too.

___________________
Emps

FAQs: Emperor

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 11-06-2002 04:36

remember to save your text files as 'ANSI'..


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 11-06-2002 04:37

yeah bit! I was hoping it was an editor or server issue (as opposed to operator error)

I use maX's HTML Beauty, I believe butcher does too, how about you Emps?

I've cross posted this at the forums of my host, I'll pop in here if I get anything good there.

Keep the theories coming tho folks, tho I'm calming, I may still kill late this evening if forced to endure much longer.

Jason

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2002 04:51

JKMabry: I'm a little promiscuous (sp?) and use Notepad, Wordpad, Beauty and 1stPage as the mood takes me. I know Butcher was able to edit the file and save it in Beauty when I had struggled in Notepad and Wordpad but I have also tried in all of them in the past. Sometimes the whitespace disappears when I save and sometimes I need to close it down and open it again.

I have wondered if it might be a memory thing but it ties in with your extra whitespace problem (as of tonight) so who knows?

___________________
Emps

FAQs: Emperor

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 11-06-2002 05:08

Is the server UNIX? Is there any remote possibility the files are converted to UNIX line endings automatically when saved to the server?

Bah. What the heck do I know. I'm a graphics weenie.

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 11-06-2002 05:09
quote:
This is driving me absolutely insane, I want to choke someone or something.



Not that I can help with the problem itself, but if you need a little stress relief... well, shock therapy always did wonders for me.... I'll be down in the basement if you need me.

maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 11-06-2002 05:13

something else I've noticed (this may just be the ftp server I'm using but) if you overwrite a file with a smaller file it'll keep the ending of the smaller file often times. I could not figure this out for the longest time and it was driving me crazy. But ya, that's probably just the ftp server I'm using. Now I just delete something and then ftp it instead of just overwriting it. BTW ftping with the command prompt is the best, who needs a gui.

behmer - Google Bomb, for my dad's site.
kewlster

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2002 05:55

After a quick chat with Steve it appears the disappearing whitespace/line returns was due to his saving it with Macintosh line endings (rather than Unix o DOS). This doesn't, however, explain why when opened and saved through Beauty that it added about 5 or 6 extra returns. However, it might add some piece of evidence to the mystery.

___________________
Emps

FAQs: Emperor

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 11-06-2002 16:33

Excellent, one for the archives fellas! From my host's board reply...

quote:
You will need to add ".TPL" to the list of text files in WS_FTP, and make sure WS_FTP is set to "auto-detect".

Windows use a CR/LF pair for the end of a line, while Linux uses just a LF. The extra lines are added when you upload a text file from a Windows computer to a Linux computer in binary mode, and download it back to the Windows computer in ASCII mode. The text file becomes corrupted because for each LF character in the file, ASCII mode puts a CR before it, whether or not there are any CR characters already before the LF character. The file remains corrupted until you remove the extra CR characters. To remove the extra CR characters, download the text file from the Linux computer as BINARY then upload it to the Linux computer as ASCII, and download to Windows computer again as ASCII.

ie
Windows "text\CR\LF" (BINARY mode)-> Linux "text\CR\LF" = OOPS!
Linux "text\CR\LF" (ASCII mode)-> Windows "text\CR\CR\LF" = DOUBLE OOPS!
Windows "text\CR\CR\LF" (BINARY mode)-> Linux "text\CR\CR\LF" = TRIPLE OOPS!
Linux "text\CR\CR\LF" (BINARY mode)-> Windows "text\CR\CR\LF" = NOT OK YET
Windows "text\CR\CR\LF" (ASCII mode)-> Linux "text\LF" OK on Linux
Linux "text\LF" (ASCII mode)-> Windows "text\CR\LF" = OK on Windows

And, to add to the confusion, Apple systems (from the ancient Apple II to the latest MacOS) use CR by itself as the line break character, so that you can have even more wild and wonderful forms of file corruption if a Mac has been somewhere in the file's history. (I think the Commodore 64 also used CR alone, along with even weirder perversions of ASCII, but that's ancient history.)

Surprisingly, of all of these systems, it's actually the ones from Microsoft that got the standards right (a rare thing for MS)... the traditional line break sequence, dating back to ancient Teletypes and continuing on mainframe systems like the DECSYSTEM-20, is CR+LF, with the CR signifying that the cursor should move to the start of the line and the LF indicating that it should jump down to the next line. The decoupling of the two operations instead of having one imply the other was one of those "seemed like a good idea at the time" things for the early standards-makers, as it enabled some special effects on Teletype terminals like using a CR without LF to overstrike things on the current line, but later programmers though it wasteful and decided the newline should be a single character, but couldn't be consistent about which one, unfortunately.



2nd paragraph there^ would explain why it was so hard to pattern the problem, up/down/up and all that jazz.

Jason

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2002 17:41

JKMabry: That explains all the problems reported above - nice I've added this to the FAQ:

Why do I get a lot of whitespace in my files/code when I uploaded and download files?

___________________
Emps

FAQs: Emperor

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 11-06-2002 17:48

Just to be clear, is this a WS_FTP thing or a server thing? I use CuteFTP pro and UltraEdit's built in FTP and have never had this problem. (or I've never noticed it)



.:[ Never resist a perfect moment ]:.

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 11-06-2002 17:49

FAQ mastah E!

sorry I don't have FAQ-on-the-brain. I should. Duh.

Jason

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 11-06-2002 17:52

bit, it's a system thing, Win/Apple/*nix and not transferring the file in proper mode. I can't say if it's a wsFTP thing or not since I define how each file extension is transfered myself in the preferences. wsFTP may very well do it perfectly fine if I didn't mess with the default config and left all the accounts to transfer on 'auto detect'

so in summary I think it's a system thing that only comes to light if transferred in the wrong mode, with, I'd assume, any ftp client.

Jason

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2002 17:52

bitdamaged: Its possibly not even a fully FTP problem as I have had similar problems with files going between Steve, Butcher and myself.

[edit: Damn JKMabry beat me to the draw - it is a system problem that FTP glitches might highlight or exagerate. I think the lesson to learn is that if you are working on a project with other people on other OSes then you might have to make sure you have some standards for files that covers very small details like this ]

___________________
Emps

FAQs: Emperor

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 11-06-2002 18:46

Bingo. I'm still pretty new at the collaboration game. A good suggestion to anyone in that sort of envionment is - agree up front what line endings to use! BBEdit gives me options - I just never thought to utilize that.

oh well.......

« BackwardsOnwards »

Show Forum Drop Down Menu