Re: Designation standard output as File type



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/>
.



Relevant Pages

  • Re: Custom Formatting The Output Of subprocess.Popen
    ... stdout and stderr specify the executed programs' standard ... Valid values are PIPE, an existing file descriptor (a positive ... integer), an existing file object, and None. ...
    (comp.lang.python)
  • Re: switching stdout to a file
    ... On Fri, 06 May 2005 04:03:51 GMT, Norm Dresner wrote: ... > void main ... > fclose(stdout); ... a copy of a FILE object may not necessarily ...
    (microsoft.public.vc.language)
  • Re: How to access the stdout file
    ... Standard C doesn't know a thing about directories. ... I understand that stdout is a pointer to a file, ... the object 'stdout' points to a FILE object which holds meta ... Trying to read an output stream like stdout will produce ...
    (comp.lang.c)
  • Re: Custom Formatting The Output Of subprocess.Popen
    ... stdout and stderr specify the executed programs' standard ... Valid values are PIPE, an existing file descriptor (a positive ... integer), an existing file object, and None. ...
    (comp.lang.python)