This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
An absolute path is just that - an path that represents a undisputable path to a file or a directory. For example, path = c:\dir1\dir2\file Now a canonical path is similar, yet stangely different. Consider this mathimatical definition of canonical,
"Two formulas such as 9 + x and x + 9 are said to be equivalent because they mean the same thing, but the second one is in `canonical form' because it is written in the usual way, with the highest power of x first." To apply this to paths, if you have two 'paths' to the same file but one is an alias, then the other one (assuming it is an 'absolute' path) is the canonical path. The confusion stems from the fact that the use of canonical in this instance is not directly related to the true definition of the word. Sean
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Canonical means "according to the law".
"JavaRanch, where the deer and the Certified play" - David O'Meara
vishwas bhatt
Ranch Hand
Joined: Nov 30, 2000
Posts: 129
posted
0
hi cindy and sean .
ok iget what it is .. but can you give me example of canonical path. thanx alot. wating for reply.
deekasha gunwant
Ranch Hand
Joined: May 06, 2000
Posts: 396
posted
0
Hi Vishwas, first of all i'd request u to make the following structure in your c:\ c:\A\B\C\MyFile Now run the following code and you will understand it yourself.
just in case you don't want to run it. getAbsolutePath : will return u the same String with which u created the File Object. getCanonicalPath : will return the minimum length path that represents that file or directory.
run it and the meaning of these two lines will be clear to u. regards Deekasha