Alan asks a very good question.

The kinds of pathname conversion done by getNativePath
is likely already implemented in Java code somewhere.
E.g. there is this comment in ProcessImpl.java:

        // Win32 CreateProcess requires cmd[0] to be normalized
        cmd[0] = new File(cmd[0]).getPath();

I've always considered the primary purpose of getNativePath to be
native charset encoding, but for the win32 "W" API this is a no-op
because we are converting UTF-16 to UTF-16.

So I suspect we can get rid of that icky C code in getNativePath entirely,
perhaps simply replacing it by java calls to getPath() or similar functionality
extracted from something in NIO2, which is in jdk7 since b50.

Martin

On Mon, Mar 23, 2009 at 10:55, Alan Bateman <alan.bate...@sun.com> wrote:
> I'm not an expert
> on the Process code but is the directory already normalized at this point?
> Just wondering if all of getNativePath is needed.
>
> -Alan.
>

Reply via email to