• Post Reply Bookmark Topic Watch Topic
  • New Topic

A bit confused about File pathnames  RSS feed

 
Fitz Herbert
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm ,
Please could you define a Cononical, a Absoulte and a relative pathnames components
Thankyou
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An ABSOLUTE pathname contains all the information needed to locate the file that it denotes:
Examples:
c:/javaprojects/myapp/images/logo.jpg
/usr/local/java/pdf/report.pdf

A RELATIVE pathname must be interpreted in terms of information taken from some other pathname(the java.io package resolve relative pathnames against the current user directory)
Two relative paths:
../images/logo.jpg
report.pdf
A CANONICAL path is an absolute path maped in its unique form in a system-dependent way.
Example:
here you have two different absolute pathnames for the same file:
/home/user1/logs/../hello.java
/home/user1/./hello.java
This is the canonical pathname for that file:
/home/user1/hello.java

HTH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!