delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/25/20:35:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Jeff Lu" <jklcom AT mindspring DOT com>
To: "cygwin" <cygwin AT cygwin DOT com>
Subject: strange printing problem in cygwin
Date: Fri, 25 Jan 2002 20:08:28 -0800
Message-ID: <LIEBJAJMJFLPHGCPMEBGGEOJCIAA.jklcom@mindspring.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Importance: Normal

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019