Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: (OT) Fixing Line Endings

by swampyankee (Parson)
on Nov 30, 2006 at 16:34 UTC ( #586991=note: print w/replies, xml ) Need Help??


in reply to (OT) Fixing Line Endings

I'm surprised that you've got this problem when FTPing programs; my experience has been that ftp usually starts up in ASCII mode (and I usually forget to put it into binary mode, resulting in me downloading a corrupted binary, smacking my head against the monitor, turning binary mode on, and repeating the download). I have seen it when Windows and *ix boxen are networked together; apparently some networking systems are bright enough to manage big-endian - little-endian conversions but not quite intelligent enough to do end-of-line correction.

Ovid's solution is clever. Hacking ftpd may be a "superior" solution, but Ovid would be doing this on somebody else's nickel, and those somebodies may not want to pay for it.

emc

At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.

—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.

Replies are listed 'Best First'.
Re^2: (OT) Fixing Line Endings
by throop (Chaplain) on Nov 30, 2006 at 23:33 UTC
    > ftp usually starts up in ASCII mode

    Perhaps the files were in a .tar or .zip?

    Would there be a similar problem when moving Perl files en masse from *nix to Windows?

      >> ftp usually starts up in ASCII mode

      As I said, my experience has been that ftp usually starts up in ASCII mode. I believe that some ftp daemons can be configured to default to binary mode. Since most of the traffic is likely to be binary, doing so would make a good deal of sense.

      >> Perhaps the files were in a .tar or a .zip?

      From the way Ovid's original post was worded, it didn't seem so.

      >> Would there be a similar problem when moving Perl files en masse from *nix to Windows?

      Well, I know that text files can lose their end-of-record markers, turning a multi-line text file into a very long single line. I don't know whether Perl's parser will recognize \n vs \r\n as an end of line marker. It may, which could result in a perfectly valid Perl program that looks like a very long one-liner.

      emc

      At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.

      —Igor Sikorsky, reported in AOPA Pilot magazine February 2003.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586991]
help
Chatterbox?
[atcroft]: .oO(Then there is the effect if a site changes their timezone, such as when the International Date Line was moved by the purchase of Alaska by the US from Russia in 1867, or several places (I cannot recall off-hand) that moved from one side of the Date
[atcroft]: Line to the other recently....)
[atcroft]: .oO(Then again, you also have to be careful if you had it to the database, and be aware of any assumptions it makes (such as SQLite assuming Gregorian calendar and a day of exactly 86400 seconds)...)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-04-29 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.