Re: [Freedos-user] TEE truncates file

2005-04-09 Thread Jim Hall
Jose Antonio Senna wrote:
 I tested TEE with commands like 
 DIR C: |TEE CDIR
 MEM /d /f /x |TEE MAP
 and it always truncates the files,that is,some lines that appear last on
 screen do not appear in the file. I think this rules out the possibility
 of screen output being a mix of stdout and stderr.
 Can it be that TEE makes some copy mistake ?
 This happens under kernel 2035, kwc38616 and also under DrDOS.
 Regards
 JAS

Just getting back to this ... a month late.  My bad.
Ugh, I just looked at my TEE 1.0 source code, and it's fugly.  Sorry 
about that.  But at least it's easy to follow:

After TEE find the output file name, it calls outtee() like this:
  outtee (stdin, pFile, stdout);
Where 'pFile' is the file that you want to save a copy of stdin to.
I don't know why I write outtee() as a standalone function, cause it's 
so short and simple.  I wrote this when I was a student.  Anyway, the 
outtee() function just does this (brackets added for readability):

  while ((ch = fgetc (pIn)) != EOF) {
if ((fputc (ch, pSave) == EOF) || (fputc (ch, pOut) == EOF)) {
  return (FALSE);
}
  }
  return (TRUE);
That is, outtee() will keep reading a character at a time from stdin 
(passed as 'pIn') until it reaches EOF.  As it reads, it saves a copy of 
the input to 'pSave' and prints a copy to 'pOut' (this is written as 
saving a copy of the character to two output streams.)  If there's an 
I/O error while writing to 'pSave' (i.e. disk full) or if there's some 
problem writing to stdout, then it quits.

I/O buffering could get in the way of this, I suppose.
-jh

--
I'm sorry my president's an idiot. I didn't vote for him.
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


[Freedos-user] TEE truncates file

2005-03-09 Thread Jose Antonio Senna
 I tested TEE with commands like 
 DIR C: |TEE CDIR
 MEM /d /f /x |TEE MAP
 and it always truncates the files,that is,some lines that appear last on
 screen do not appear in the file. I think this rules out the possibility
 of screen output being a mix of stdout and stderr.
 Can it be that TEE makes some copy mistake ?
 This happens under kernel 2035, kwc38616 and also under DrDOS.
 Regards
 JAS
 



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] TEE truncates file

2005-03-02 Thread Jose Antonio Senna

Jim Hall wrote:
>It's possible that some of the output you see on screen was printed to 
>stderr.  TEE only works with output printed to stdout (that is, it only 
>reads stdin.)

>stderr is often used to print warnings or error messages.

 I don't think so,because the output is one continuous transcript of the
dialog between TCPMAIL and the POP/SMTP server,and there are no reasons
why those lines should have been treated differently. However,how can I
test it?  
 I also noticed there is no screen output for a time,then all output is
displayed without pause,while TCPMAIL without redirection sends the output
to screen as the dialog proceeds. So,probably,everything is redirected to a
temporary file until TCPMAIL exits and then TEE takes over and sends the
file contents to screen, afterwards copies the file to a permanent one and
exits. Is it so?
 If yes,could it be that TEE makes some copy mistake ?
 Regards
 JAS
 



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] TEE truncates file

2005-03-02 Thread Jim Hall
Jose Antonio Senna wrote:
 I have been using Tee to display and save output of a SMTP/POP client
named TCPMAIL. One example of command line is:
C:\!NET\TCPMAIL.EXE /q /d [EMAIL PROTECTED]  |C:\UTLS\TEE .\MAIL.LST
and noticed that it truncates the file (that is,some lines - perhaps 10 - that
appear last on screen are not saved to file) This does not depend on filename
nor on the tcpmail switches I use.
If I use standard DOS redirection (> or >>),it saves OK the output (but then
I get no screen output,of course).
 Did anybody notice a similar problem ?
Regards
JAS
It's possible that some of the output you see on screen was printed to 
stderr.  TEE only works with output printed to stdout (that is, it only 
reads stdin.)

stderr is often used to print warnings or error messages.
-jh
--
I'm sorry my president's an idiot. I didn't vote for him.
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


[Freedos-user] TEE truncates file

2005-03-01 Thread Jose Antonio Senna
 I have been using Tee to display and save output of a SMTP/POP client
named TCPMAIL. One example of command line is:
C:\!NET\TCPMAIL.EXE /q /d [EMAIL PROTECTED]  |C:\UTLS\TEE .\MAIL.LST
and noticed that it truncates the file (that is,some lines - perhaps 10 - that
appear last on screen are not saved to file) This does not depend on filename
nor on the tcpmail switches I use.
If I use standard DOS redirection (> or >>),it saves OK the output (but then
I get no screen output,of course).
 Did anybody notice a similar problem ?
Regards
JAS



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user