Subject: Re: problem with mounting / as binary or not
From: [email-masked] (Paul Vincent Elia)

6 Sep 1997 11:14:49 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/enriched; charset="us-ascii"
X-Sender: [email-masked]
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32)
Original-To: [email-masked] (Hubert FAUQUE), [email-masked]
In-Reply-To: <[email-masked]>
Original-Sender: [email-masked]

At 12:04 PM 8/28/97 GMT, Hubert FAUQUE wrote:

>

>I have installed Sergey's cygwin.dll and bash and I am having a

>problem:

>bash didn't find .bashrc at startup, so as I have seen on a previous

>message I have mounted c: as / with text=binary and it works for bash;

>but now is the problem: make doesn't find any include files; 

>if there is 

>  include file

>in the Makefile,

>it gives the message

>  file^M: no such file or directory

>it doesn't find the file because it adds a ^M at the end of the name;

>

>Has anybody found a solution?

>

>thanks

>

>Hubert

>

>

I know this isn't the best solution, but it may help. I wrote a simple
program (makeunix) that converts all CRLF to LF in the supplied text
file. Syntax: makeunix <<file_with_DOS_CRLFs> . It outputs to a tempfile
(same name always), deletes the original file, and renames the tempfile
back to the original filename. I've needed it for other reasons and it
has worked fine.

---

<bigger>#include <<fcntl.h>

#include <<stdio.h>

#define TEMPFILE "./~fix.tmp"

const int BUFFER_SIZE = (16 * 1024);

main (int argc, char *argv[])

{

  char buffer[BUFFER_SIZE];

  char buffer2[BUFFER_SIZE];

  int i, j, in_file, out_file, read_size;

  if (argc != 2)

    {

    printf("Usage: makeunix <<file_with_DOS_CRLFs>\n");

    exit(8);

    }

  in_file = open(argv[1],O_RDONLY);

  if (in_file<<0)

    {

    printf("Error: Could not open input file %s\n",argv[1]);

    exit(8);

    }

  out_file = open(TEMPFILE,O_BINARY|O_WRONLY|O_TRUNC|O_CREAT,0644);

  if (out_file<<0)

    {

    printf("Error: Could not create temporary output file\n");

    exit(8);

    }

  while(1)

    {

    read_size = read(in_file,buffer,sizeof(buffer));

    if (read_size==0) break; // End of file

    if (read_size<<0)

      {

      printf("Error: Problem reading from input file %s\n", argv[1]);

      exit(8);

      }

    for (i=j=0;i<<read_size;i++) if (buffer[i]!='\015')
buffer2[j++]=buffer[i];

    write(out_file,buffer2,(unsigned int)j);

    }

  close(in_file);

  close(out_file);

  remove(argv[1]);

  rename(TEMPFILE,argv[1]);

  return(0);

}

---</bigger>

--

Paul V. Elia, President, IT Atlanta, Inc., Information Technology Consultants

    (404) 467-8485    fax: (404) 846-9124    http://www.itatlanta.com
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".