MacOS file system changes between 7u10 and 7u40?
Philippe Marschall
philippe.marschall at gmail.com
Sun Oct 6 10:27:34 PDT 2013
On Fri, Oct 4, 2013 at 5:30 PM, Martin Buchholz <martinrb at google.com> wrote:
> It is already the case that you cannot access all possible Unix file names
> from Java because by design, file names are represented by Java strings
> (UTF-16), but at the OS level filenames are actually arbitrary byte
> sequences with no concept of encoding.
While file names are Strings and java.io.File is String based
sun.nio.fs.UnixPath is actually byte[] based. This means so you can
access files whos name is not valid in the respective encoding given
you can get a hold of the path. The "easy way" is through
DirectoryStream the other through the package protected constructor.
(Yes I did some checking on a Linux box with file names that are invalid UTF-8).
Cheers
Philippe
More information about the nio-dev
mailing list