This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strange printing problem in cygwin


Hi,

I have a c program that sends data output to different printers.

Here is the code:

int main()
{
  FILE *printHandle;
  char contentType[] = "text/html", buffer[100];

  printf("Content-Type: %s\n\n", contentType);

  strcpy(buffer, "This is a test\n");

  printHandle = fopen("//pc0/printer0","wb");
  if(printHandle)
  {
    fwrite(buffer, sizeof(char), strlen(buffer), printHandle);
    fclose(printHandle);
  }

  printHandle = fopen("//pc1/printer1","wb");
  if(printHandle)
  {
    fwrite(buffer, sizeof(char), strlen(buffer), printHandle);
    fclose(printHandle);
  }

  printHandle = fopen("//pc2/printer2","wb");
  if(printHandle)
  {
    fwrite(buffer, sizeof(char), strlen(buffer), printHandle);
    fclose(printHandle);
  }
  return(0);
}

pc0 is local printer
pc1 & pc2 are network printers

Here's the problem:

Program is executed from a command line on pc0

1st execution: "This is a test" is printed to printer0
2nd execution: "This is a test" is printed to printer1
3rd execution: "This is a test" is printed to printer2
4th execution: "This is a test" is printed to printer0
5th execution: "This is a test" is printed to printer1
..
..
..


However, when the program is executed through http request (in an intranet
evirnoment)

1st execution: "This is a test" is printed to both printer0 and printer1 but
printer2

2nd execution on up:  "This is a test" only gets printed to printer0


Seems like stdout is not getting reset.  Is this a configuration issue in
cygwin?  What can I do to be able to print to all the printers all at once?

Thanks


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]