The explanation example for the last option ( ..\..\index.html ) says that:
“A ".." implies parent folder, therefore imagine that you are taking off one ".." from the right side of the plus sign and removing the last name of the path on the left side of the plus sign.”
Notice how the filename is removed and not part of the the path. Hence the example contradicts the explanation. This is especially misguiding since the filename is irrelevant in order to relativize the path.
The given explanation is correct. It shows an easy way to resolve the dot dots. The last name of the path on the left side of + os readme.text and that is what cancels out the .. on the right side of +.
BTW, a "path" includes everything in the Path object. Whether the path ends with a file name or a directory name is irrelevant. As far as the path is concerned, each component of the path is a name. readme.txt looks like a file name but it could very well be a directory.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
admin wrote:BTW, a "path" includes everything in the Path object. Whether the path ends with a file name or a directory name is irrelevant. As far as the path is concerned, each component of the path is a name. readme.txt looks like a file name but it could very well be a directory.
You are right about that. I really had a hard time grasping that the file name was part of the path and therefore ".." would cancel it out.