[TriLUG] CR/LF
Andrew Perrin
clists at perrin.socsci.unc.edu
Sun Feb 27 07:30:21 EST 2005
My reading of William's message is that he's asking if it matters in this
case:
> files. Thus, sending it from one normal system (mac) to another (linux)
> shouldn't matter via either ascii or binary, correct?
ap
----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
On Sat, 26 Feb 2005, Rick DeNatale wrote:
> But William asked for confirmation that ASCII vs BINARY transfer mode
> didn't matter. My point was that ASCII vs BINARY mode transfer does
> matter in that in BINARY mode neither the client nor server will make
> any changes to the data. In ASCII mode they will try to convert from
> the line separation and file end representations between the two if it
> is necessary.
>
>
> On Sat, 26 Feb 2005 14:41:20 -0500 (EST), Andrew Perrin
> <clists at perrin.socsci.unc.edu> wrote:
> > No, William is right - the ASCII transfer mode will handle any discrepancy
> > between Mac and Linux, but won't handle the fact of its being eventually
> > read on Windows, unless Windows is on one end of the FTP transfer. I
> > hadn't thought of that!
> >
> > ap
> >
> > ----------------------------------------------------------------------
> > Andrew J Perrin - http://www.unc.edu/~aperrin
> > Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> > clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
> >
> > On Sat, 26 Feb 2005, Rick DeNatale wrote:
> >
> > > It does matter. In a binary mode transfer you want a byte for byte
> > > copy, you don't want to translate bytes which happen to be cr, lf,
> > > etc.
> > >
> > > ASCII mode tells the FTP client and server that line end sequences and
> > > end of file characters should be translated when necessary.
> > >
> > >
> > > On Fri, 25 Feb 2005 20:45:29 -0500 (EST), William Sutton
> > > <william at trilug.org> wrote:
> > > > Question for you guys saying "transfer it in ascii mode": If I understand
> > > > right, Windows is the one doing the CRLF conversion from normal (mac/unix)
> > > > files. Thus, sending it from one normal system (mac) to another (linux)
> > > > shouldn't matter via either ascii or binary, correct?
> > > >
> > > > I think he's going to have to opt for a solution like this:
> > > > 1. mac user uploads file.working
> > > > 2. mac user renames file.working -> file.ready
> > > > 3. cron job finds file.ready, converts it dos2unix
> > > > 4. cron job renames file.ready -> file.done
> > > > 5. coder picks up file.done
> > > >
> > > > Thoughts?
> > > >
> > > > William
> > > >
> > > > On Fri, 25 Feb 2005, Jeff Groves wrote:
> > > >
> > > > > Another option is to transfer the files in ASCII mode instead of BIN
> > > > > mode in FTP.
> > > > >
> > > > > That is supposed to do the end of line conversion as well.
> > > > >
> > > > > Jeff G.
> > > > >
> > > > > Andrew Perrin wrote:
> > > > >
> > > > > >>From memory, I think setting the FTP mode to "ascii" instead of "bin" will
> > > > > >take care of this - but it's been a while so I could be wrong.
> > > > > >
> > > > > >You could also run it through unix2dos which I think does essentially the
> > > > > >same thing. Or, barring everything else, you could run it through
> > > > > >
> > > > > >perl -pi -e 's/\013/\013\010/'
> > > > > >
> > > > > >Andy
> > > > > >
> > > > > >----------------------------------------------------------------------
> > > > > >Andrew J Perrin - http://www.unc.edu/~aperrin
> > > > > >Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> > > > > >clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
> > > > > >
> > > > > >
> > > > > >On Fri, 25 Feb 2005, Mark Freeze wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >>I have a customer that sends files to my ftp site (currently on a
> > > > > >>Windows Server box) from his Mac platform. The files are nothing
> > > > > >>special, just delimited text files. However they can be very large.
> > > > > >>(i.e. 100,000 records or 75MB) The problem is this: When I switched
> > > > > >>the ftp server to my Linux box, my Windows conversion programs no
> > > > > >>longer worked. After much looking, I found the reason was that the
> > > > > >>files sent from the Mac had each line in the data termintated with a
> > > > > >>hex '0A'. When placed on the windows box the file magically converted
> > > > > >>itself somehow to have a '0D' '0A', asc(13) asc(10), or cr/lf pair
> > > > > >>terminating each line. So, to make my long story short, when I
> > > > > >>download files from my Windows box, my VB programs can use them, but
> > > > > >>when I download them from my Linux server my programs crash. (Because
> > > > > >>of the missing '0D' - VB wants to have a line terminated by a cr/lf
> > > > > >>to use the LINE INPUT command.) What do you think would be the
> > > > > >>easiest, and most importantly *non-interactive* way to handle this
> > > > > >>problem?
> > > > > >>
> > > > > >>Thanks in advance for any help.
> > > > > >>
> > > > > >>Regards,
> > > > > >>Mark.
> > > > > >>
> > > > > >>------
> > > > > >>"I told them I'd ridden shooting stars and said I'd show them how..." --Ozzy
> > > > > >>--
> > > > > >>TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > > > > >>TriLUG Organizational FAQ : http://trilug.org/faq/
> > > > > >>TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > > > > >>TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
> > > > > >>
> > > > > >>
> > > > > >>
> > > > >
> > > > >
> > > > >
> > > > --
> > > > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > > > TriLUG Organizational FAQ : http://trilug.org/faq/
> > > > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > > > TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
> > > >
> > > --
> > > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > > TriLUG Organizational FAQ : http://trilug.org/faq/
> > > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > > TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
> > >
> > --
> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
> >
> --
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
>
More information about the TriLUG
mailing list