Re: Designation standard output as File type
- From: dagon@xxxxxxxxx (Mark Rafn)
- Date: Fri, 30 Nov 2007 13:24:49 -0800
Alan <jalanthomas@xxxxxxxxxxx> wrote:
My question: To what do I set outFile (File type) to make the
output go to standard output (display)? System.out is of a type
PrintStream.
Right. The first line of javadoc for java.io.File makes this clear: "An
abstract representation of file and directory pathnames."
stdout is not a path name. It's an output stream.
public static void printData(File dir, File outFile)
You'll need to write a printData method that takes an OutputStream (or better,
a Writer). There is no path for stdout, so there is no File object that
represents it.
--
Mark Rafn dagon@xxxxxxxxx <http://www.dagon.net/>
.
- References:
- Designation standard output as File type
- From: Alan
- Designation standard output as File type
- Prev by Date: Re: Great SWT Program
- Next by Date: Re: Great SWT Program
- Previous by thread: Re: Designation standard output as File type
- Next by thread: Newbie wants to self-taught java
- Index(es):
Relevant Pages
|