Nexus 7, Android 4.3: Same directory, two canonica

2019-06-18 08:11发布

问题:

I'm using a Nexus 7 running Android 4.3. Two directory paths on this device are confusing me:

/storage/emulated/legacy
/storage/emulated/0

If I call new File(<path>).getCanonicalPath() for either of these, I get the same path back. If I call the C function realpath with either, it succeeds and returns the same path. So it sounds like each of these is its own canonical path, and therefore they are different directories.

However, If I create a subdirectory in either one, that subdirectory also appears in the other. That gives me the impression that they are two paths to the same directory.

Is there a better way to tell that these paths are really for the same directory?