From: Kiran Atlluri > [...] > I am trying to retrieve a ?.csv? file on a unix system using wget (ftp > mode).I > > When I retrieve a file using normal FTP and specify ASCII mode, I > successfully get the file and there are no ? ^ M ? at the end of line in > this file. > > But when I use wget all the lines in the file have this ? ^M ? at the > end. > [...]
This happens because write_data() (in "src/retr.c") does nothing to adjust the FTP-standard CR-LF line endings according to the local standard (in this case, LF-only), which a proper FTP client should do. A fix for this was included among my recent (well, not _very_ recent now) VMS-related patch submissions, but it would probably be a mistake to hold your breath waiting for those changes to be incorporated into the main code stream. If you're desperate to see what I did to fix this, you could visit: http://antinode.org/ftp/wget/patch1/ ftp://antinode.org/wget/patch1/ A quick search for the (new) enum value "rb_ftp_ascii" suggests that the relevant changes are in "ftp.c", "retr.c", and "retr.h". Feel free to get in touch if you have any questions about what you find there. (The new code does make one potentially risky assumption, but it's explained in the comments.) ------------------------------------------------------------------------ Steven M. Schweda (+1) 651-699-9818 382 South Warwick Street [EMAIL PROTECTED] Saint Paul MN 55105-2547