You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Julius Davies <ju...@cucbc.com> on 2005/01/07 08:58:55 UTC
RE: [net] Strange System.out behavior
Hi, Chris,
To me that sounds like the sort of thing that might happen if:
- You changed JDK?
- You changed Operating System?
- You are using a different console/terminal?
I don't think it would have anything to do with Commons-Net, but I wouldn't want to stake my life on that either. ;-)
So if you do this, you see nothing?
=================
System.out.print("Uploading file: " + convertSlashes(next) + "...");
System.out.flush();
=================
yours,
Julius
-----Original Message-----
From: Chris Bergstresser [mailto:chris@subtlety.com]
Sent: Thu 1/6/2005 8:12 PM
To: commons-user@jakarta.apache.org
Cc:
Subject: Strange System.out behavior
Hi all --
I just ported over my previous application to the Commons/Net FTP
library, and I'm seeing a strange bug. The following snippet used to work:
System.out.print("Uploading file: " + convertSlashes(next) + "...");
InputStream in = new FileInputStream(f);
ftp.storeFile(convertSlashes(next), in);
System.out.println("done");
But now nothing gets printed until the println. I even tried adding a
System.out.flush(), but no dice. Nothing's printed to the console without a
println().
Any ideas what's going on?
-- Chris
--
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.7 - Release Date: 12/30/2004
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
RE: [net] Strange System.out behavior
Posted by Chris Bergstresser <ch...@subtlety.com>.
Julius Davies wrote:
> Hi, Chris,
>
> To me that sounds like the sort of thing that might happen if:
>
> - You changed JDK?
> - You changed Operating System?
> - You are using a different console/terminal?
Nope. Same JDK, same OS, same console. As it turns out, it works when I
run as a standalone program -- the bug appears to be in the way Ant handles
System.out, although I would almost swear Ant was handling this fine before.
> So if you do this, you see nothing?
>
> =================
> System.out.print("Uploading file: " + convertSlashes(next) +
> "..."); System.out.flush(); =================
Right. Ant apparently embargoes all the output to System.out until a
newline is reached, which probably isn't intended behavior, exactly, but
what can you do?
-- Chris
--
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.7 - Release Date: 12/30/2004
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org