RFR: 8132541 : (process) ProcessBuilder support for redirection to discard output
Martin Buchholz
martinrb at google.com
Tue Sep 22 06:52:09 UTC 2015
On Mon, Sep 21, 2015 at 11:28 AM, Roger Riggs <Roger.Riggs at oracle.com>
wrote:
> Hi Martin,
>
> On 09/21/2015 02:18 PM, Martin Buchholz wrote:
>
>
> I'm not sure that all operating systems where Java may run will have such
> a "null file" (does OS400?).
>
> True, but there are multiple ways to discard the output and it need not be
> via the null file,
> that's just easy on Unix and Windows.
> The Redirect.file() method is allowed to return null and I've updated the
> description to reinforce that for OS's that discard the output some other
> way.
>
That seems to contradict what I see here:
+ /**
+ * Indicates that subprocess output will be discarded.
+ * The output is discarded by writing to the operating specific
+ * <em>null</em> file.
+ *
+ * <p>It will always be true that
+ * <pre> {@code
+ * Redirect.DISCARD.file() the filename appropriate for the
operating system &&
+ * Redirect.DISCARD.type() == Redirect.Type.WRITE &&
+ * Redirect.DISCARD.append() == false
+ * }</pre>
+ * @since 9
+ */
+ public static final Redirect DISCARD = new Redirect() {
I think there will be confusion if the "null file" can be null.
More information about the core-libs-dev
mailing list