.NET code for dos2unix

  • Thread starter Thread starter Tam OShanter
  • Start date Start date
T

Tam OShanter

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.
 
Tam OShanter said:
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.
 
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.
 
Michael D. Ober said:
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 said:
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
 
Back
Top