delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/13/07:48:19

From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Please Help: Printf problem argv[] issues. LFN?
Date: 13 Sep 1997 05:17:18 GMT
Organization: The National Capital FreeNet
Lines: 38
Message-ID: <5vd7ku$ld2@freenet-news.carleton.ca>
References: <5vcnai$s2q AT camel3 DOT mindspring DOT com>
Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
NNTP-Posting-Host: freenet5.carleton.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


"Joshua Cannon Butcher" (lchandar AT mindspring DOT com) writes:
> I am writing a command line DOS utility and use a FOR command for =
> several tasks.  While the for command is executing, I am using a printf =
> statement to update progress.  This code was taken directly from a =
> similar utility I wrote with Borland C++.  the printf in the for command =
> DOS NOT update on the screen until the for command is finished =
> executing, and all the progress shows up at once.  Why?  Also, if I use =
> GetCh() in CONIO.H and use printf to print a statement before the =
> GetCh(), it does not show the statement (prompt for input ifyou will) =
> until after the key is pressed. =20

Unlike Borland, DJGPP line-buffers stdio. Add fflush(stdout) after the
printf's in the loop (or a \n at the end of the line) and all should work.

printf (args...);  fflush(stdout); 
should update immediately.

> Also, how do I stop my EXE file from automatically expanding wild card =
> file masks on the command line?

There's a CRT-startup-flag thing for that I think. Check the docs or wait
for a followup by someone more knowledgeable than I. (Eli?)

> And, is there a switch i can use to compile my program to automatically =
> look at LFN rather than having to set LFN=3Dy?

Well, there must be a mistake or typo here. There is no code in DJGPP that
looks for LFN set to "3Dy". It should be just set LFN=y. I am not aware of
any such switch, nor do I know there isn't one, again check the dox or
wait for followups.


--
    .*.  Where feelings are concerned, answers are rarely simple [GeneDeWeese]
 -()  <  When I go to the theater, I always go straight to the "bag and mix"
    `*'  bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh

- Raw text -


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