^M(Clt M) character

From: Venkat (venkat_kp_at_yahoo.com)
Date: 09/20/04


Date: Mon, 20 Sep 2004 11:05:49 +0530

Hi All,

I wrote a simple copy of text file to some other location.
I could see ^(Cltr M) character getting inserted at the end of each line in
the file.

PFB my program(copying test.txt file to TestFile.txt)

 std::string TestFile;
 TestFile = PATH + test;

        FILE *fp1 = fopen(TestFile.c_str(), "wb");
        FILE *fp2 = fopen(test.c_str(), "rb");
        int Byte1;

        if (fp1 == NULL)
        {
                fprintf(fp, "\n Cannot open destination file %s",
TestFile.c_str());
                return -1;
        }

        if (fp2 == NULL)
        {
                fprintf(fp, "\n Cannot open source file %s", test.c_str());
                return -1;
        }

        while(Byte1!=EOF)
        {
                Byte1 = fgetc(fp2);
                if(Byte1!=EOF)
                        fputc(Byte1,fp1);
        }

        fprintf(fp, "\n Copied Test File to %s location",TestFile.c_str());
        fclose(fp2);
        fclose(fp1);

Please advice.

regards,
Venkat



Relevant Pages

  • REVIEW: "Perfect Passwords", Mark Burnett
    ... (Burnett also states that the choice of strong passwords ... but elsewhere it is suggested that a ten character password ... Miscellaneous advice about ... Five hundred weak passwords are listed in chapter nine, ...
    (rec.arts.books.reviews)
  • Re: -Crawl- YASD: I died, how sad :-/
    ... You've already gotten some advice, ... > assume since you are in the Crypt that you already had the runes ... A melee/ranged character needs to be much more buff to ... > with (mostly because I can't resist turning to spells or rods ...
    (rec.games.roguelike.misc)
  • Re: writing to a partition
    ... and sit waiting in a loop or for a key press. ... don't even need to do much given that you can use the bios ... a character and sending it to the bios point that displays a character, ... Some of this is good advice in reply to my original question, ...
    (comp.os.linux.misc)
  • Re: writing to a partition
    ... and sit waiting in a loop or for a key press. ... don't even need to do much given that you can use the bios ... a character and sending it to the bios point that displays a character, ... Some of this is good advice in reply to my original question, ...
    (comp.os.linux.misc)
  • Re: CONTAINS and non-wildcard asterisk
    ... > frameworks char.IsLetterOrDigit to determine if a character is searchable. ... > Best regards ... >> platforms that might result in different indexing strategies. ...
    (microsoft.public.sqlserver.fulltext)