[Mono-list] newline and cvs

Gaurav Vaish gvaish@iitk.ac.in
Sun, 3 Mar 2002 19:35:38 +0530


You are right...
    people like me, who are involved in building class libraries, apart from
corlib and/or System assemblies need to be on Windows for testing, checking
various behaviours etc.

    And with IDEs like SharpDevelop, CRLF is the only thing that's possible.
    Initially I started off with TextPad, which supports LF and CRLF, but it's
not too feasible for C#, moresoover because it's not an IDE.

    I made a small tool (that uses tclsh :( ) to convert crlf to lf, though it's
pretty easy in perl. Though it may be preached that the server should do this
job, but I am not in favour of this. It should be the developer who should do
this lest the server gets too slow - just parse a whole file everytime something
is added. Well, incremental data can only be also put to parsing --- can't say
much since not too fluent in CVS technology.

---------------------------
#! /usr/bin/perl

while(<STDIN>)
{
    convert $_;
}

sub convert
{
    my $file = shift;
    open(FILE, " <$file");
    @newData = ();
    while(<FILE>)
    {
        chomp;
        push @newData, $_, "\n";
    }
    close(FILE);
    open(FILE, ">$file");
    foreach $line (@newData)
    {
        print FILE, $line;
    }
    close(FILE);
}
---------------------------

    Ah, I just made it. I will now change my original program -- I don't prefer
to use tclsh now because of its absence on Cygwin. ;-)

Cheers,
Gaurav Vaish
http://home.iitk.ac.in/student/gvaish
http://calendar.yahoo.com/mastergaurav
---------------------------------


----- Original Message -----
From: "Daniel Stodden" <stodden@in.tum.de>
To: "Mono Developers" <mono-list@ximian.com>
Sent: Sunday, March 03, 2002 18:11
Subject: Re: [Mono-list] newline and cvs