private function readLink($filesystemPath)
{
// On Windows, transitive links are resolved to the final target by
// readlink(). realpath(), however, returns the target link on Windows,
// but not on Unix.
// /link1 -> /link2 -> /file
// Windows: readlink(/link1) => /file
// realpath(/link1) => /link2
// Unix: readlink(/link1) => /link2
// realpath(/link1) => /file
// Consistency FTW!
return '\\' === DIRECTORY_SEPARATOR ? realpath($filesystemPath) : readlink($filesystemPath);
}