Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused with paths

 
Amit Batra
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please explain me the diff between absolute paths and relative paths, Im cant seem to be able to figure the exact difference between the two.
 
Rohit Nath
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this is the right forum for this question. Anywaz...
Here we go...

Absolute path: giving path starting from the root directory.
Example your root directory say is c: (C drive)
If you have a file myFile.txt in a folder myFolder which is inside another folder myFolder1 present at c:

The to access that file you can give the path
c:\myFolder1\myFolder\myFile.txt

Here you are giving entire path from "root directory". This is called absolute path.

Relative Path:
If you are already in some folder myFolder1 which is a part of the path in which your file is present then you need not start from root directory. Instead you can simply use \myFolder\myFile.txt
This is "realtive" to the CURRENT directory.
Relative means with respect to current active directory.

Hope it helps..
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's try Java In General (Beginner)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic