Unix paths as bytes

Philip Jenvey pjenvey at underboss.org
Sat Apr 24 18:45:13 PDT 2010

On May 1, 2009, at 6:03 PM, Philip Jenvey wrote:

> UnixPath solves the issue of java.io.File treating unix paths as Strings (e.g. http://bugs.sun.com/view_bug.do?bug_id=4899439 ) -- but AFAICT not for all situations on the JVM.
> For example in Jython, paths are represented by Strings, not wrapper objects

> Can we allow access to UnixPath's byte representation of path names and the reverse: the ability to create a Path object from said bytes?

On May 4, 2009, at 3:49 AM, Alan Bateman wrote:

> It would be easy to expose the bytes with something like toString(CharsetDecoder) and a corresponding FileSystem.getPath(String,CharsetEncoder) for import but I wouldn't expect it would be used by regular applications.

Hi Alan,

To revisit this issue I brought up a year ago, Jython could still use efficient access to the underlying bytes of a Path object. The additional API you proposed would do it -- I can work up a patch for this if you're up for considering its inclusion.

For Windows I suppose the extra encoder/decoder arguments would just be ignored

Philip Jenvey

More information about the nio-dev mailing list