Dmitriy Deyneko

Greenhorn
+ Follow
since May 20, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dmitriy Deyneko

Thank you, the question is closed.

In Windows runtime environment \home\joe\ path is not absolute but has root component. The root component is \.
As API Docs said about Path.resolve(path) method =

Where the given path has a root component then resolution is highly implementation dependent and therefore unspecified


Therefore, we can't expect some specific and defined output from Path.resolve method.

I've make a mistake in the theme of topic - of course Path is an Interface.
10 years ago
Good day!

As we can see in API documentation, the aim of the method (from the post subject )is to resolve the given path against this path.

2 particular cases:
A. If the given path is absolute

If the other parameter is an absolute path then this method trivially returns other.

B. If the given path is not empty and not absolute

Otherwise this method considers this path to be a directory and resolves the given path against this path. In the simplest case, the given path does not have a root component, in which case this method joins the given path to this path and returns a resulting path that ends with the given path.


But can somebody explain results of running the following code:
----printed text--------
isAbsolute method return - \home\joe : false
resolve method return - \home\joe
toAbsolutePath method return - C:\home\joe
---------------------------
Why does resolve method returns original path, like if the 'path' argument is absolute? at the same time isAbsolute method invoked on 'path' returns false.
Thank you!
10 years ago