From owner-freebsd-questions@FreeBSD.ORG Wed May 26 09:03:34 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 08A0B16A4CE for ; Wed, 26 May 2004 09:03:34 -0700 (PDT) Received: from adur.net (ns1.adur.net [212.74.21.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40EA943D49 for ; Wed, 26 May 2004 09:03:33 -0700 (PDT) (envelope-from Richard@Tribune-IS.com) Received: from Richard by adur.net (MDaemon.PRO.v7.1.0.R) with ESMTP id md50000102434.msg for ; Wed, 26 May 2004 17:05:52 +0100 From: "Richard Burnett-Godfree" To: Date: Wed, 26 May 2004 17:09:53 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Authenticated-Sender: Richard@Tribune-IS.com X-Spam-Processed: mail.adur.net, Wed, 26 May 2004 17:05:52 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 212.74.21.93 X-Return-Path: Richard@Tribune-IS.com X-MDaemon-Deliver-To: questions@FreeBSD.org X-MDAV-Processed: mail.adur.net, Wed, 26 May 2004 17:05:58 +0100 Subject: fputs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Richard@Tribune-IS.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2004 16:03:34 -0000 I am trying to port software currently running on hp-ux to freeBSD 4.9. In the code the software use fputs to output chars to the terminal. What seems to be happening is these are all buffered until the process terminates and then they all come out rather than being sent to the terminal during the program operation. Do I need to change an environment setting ?? Should I swap to printf ?? What is the syntax ?? Regards Richard term = (char *) getenv("TERM"); if (strcmp(term, "wy50") == 0 || strcmp(term, "wy60") == 0) {fputs ("\033z(", stdout); if (argc == 1) { fputs (trmess, stdout); if (strlen(trmess) != 78) fputs ("\015", stdout); } else { strcpy (trmess, argv[1]); fputs (argv[1], stdout); if (strlen(trmess) != 78) fputs ("\015", stdout); } }