473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

.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.

Mar 15 '07 #1
4 3796
Tam OShanter <ta*@oshanter.comwrote:
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 - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 15 '07 #2
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]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
Tam OShanter <ta*@oshanter.comwrote:
>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 - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


Mar 16 '07 #3
Michael D. Ober <obermd.@.alum.mit.edu.nospamwrote:
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 - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 16 '07 #4
Jon Skeet wrote:
Michael D. Ober <obermd.@.alum.mit.edu.nospamwrote:
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

--
http://barrkel.blogspot.com/
Mar 16 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: david | last post by:
Hi there, Does anybody know of some restriction that stops the apache user on doing a dos2unix on a file upload from php? I'm getting 'permission denied' on some temp file that it tries to...
51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
0
by: Tam OShanter | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.