.NET code for dos2unix

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tam OShanter

    #1

    .NET code for dos2unix

    Hello,

    I have a .NET application that FTP's text files to a Unix server for further
    processing.

    One of the step in the processing on the Unix server is running each text
    file through the dos2unix utility.

    dos2Unix converts Dos text file line endings to Unix line endings.

    I wish to reduce the amount of processing on the server and also hopefully
    process my files faster.
    Any suggestions on how to go about this?

    Any and all help is warrmly appreciated.

    Rgds,

    T.



  • Jon Skeet [C# MVP]

    #2
    Re: .NET code for dos2unix

    Tam OShanter <tam@oshanter.c omwrote:
    I have a .NET application that FTP's text files to a Unix server for further
    processing.
    >
    One of the step in the processing on the Unix server is running each text
    file through the dos2unix utility.
    >
    dos2Unix converts Dos text file line endings to Unix line endings.
    >
    I wish to reduce the amount of processing on the server and also hopefully
    process my files faster.
    Any suggestions on how to go about this?
    Well, if you convert the line endings from \r\n to \n on the client
    side, and then transfer in binary mode, you shouldn't need to do
    anything on the server.

    --
    Jon Skeet - <skeet@pobox.co m>
    http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
    If replying to the group, please do not mail me too

    Comment

    • Michael D. Ober

      #3
      Re: .NET code for dos2unix

      I would transfer these files in ASCII mode. Let the FTP client and server
      work for you. This has the added benefit of providing additional OS
      independence since there are multiple variations on the end of line marker.
      The FTP Server and client negotiate this during the connection and make the
      appropriate changes for you.

      Mike Ober.

      "Jon Skeet [C# MVP]" <skeet@pobox.co mwrote in message
      news:MPG.2063b3 02f4cea7df98d9a 2@msnews.micros oft.com...
      Tam OShanter <tam@oshanter.c omwrote:
      >I have a .NET application that FTP's text files to a Unix server for
      >further
      >processing.
      >>
      >One of the step in the processing on the Unix server is running each text
      >file through the dos2unix utility.
      >>
      >dos2Unix converts Dos text file line endings to Unix line endings.
      >>
      >I wish to reduce the amount of processing on the server and also
      >hopefully
      >process my files faster.
      >Any suggestions on how to go about this?
      >
      Well, if you convert the line endings from \r\n to \n on the client
      side, and then transfer in binary mode, you shouldn't need to do
      anything on the server.
      >
      --
      Jon Skeet - <skeet@pobox.co m>
      http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
      If replying to the group, please do not mail me too
      >


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: .NET code for dos2unix

        Michael D. Ober <obermd.@.alum. mit.edu.nospamw rote:
        I would transfer these files in ASCII mode. Let the FTP client and server
        work for you. This has the added benefit of providing additional OS
        independence since there are multiple variations on the end of line marker.
        The FTP Server and client negotiate this during the connection and make the
        appropriate changes for you.
        Possibly. Personally I've always felt nervous about ASCII mode - never
        quite trusted it. Couldn't tell you exactly why, other than the
        irritation of accidentally transferring binary files in ASCII mode...

        --
        Jon Skeet - <skeet@pobox.co m>
        http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
        If replying to the group, please do not mail me too

        Comment

        • Barry Kelly

          #5
          Re: .NET code for dos2unix

          Jon Skeet wrote:
          Michael D. Ober <obermd.@.alum. mit.edu.nospamw rote:
          I would transfer these files in ASCII mode. Let the FTP client and server
          work for you. This has the added benefit of providing additional OS
          independence since there are multiple variations on the end of line marker.
          The FTP Server and client negotiate this during the connection and make the
          appropriate changes for you.
          >
          Possibly. Personally I've always felt nervous about ASCII mode - never
          quite trusted it. Couldn't tell you exactly why, other than the
          irritation of accidentally transferring binary files in ASCII mode...
          Once upon a time, a long time ago, in the era of 33.6Kbit modems, I
          downloaded a 300MB archive, and for some reason the combination of
          server and client decided to use TEXT FTP mode. It got its '\n'
          converted to "\r\n", thus rendering many, many hours of downloading a
          waste of time and money.

          -- Barry

          --

          Comment

          Working...