GeekInterview.com
Series: Subject: Topic:
Question: 183 of 183

What is relative path and absolute path?

Absolute path : Exact path from root directory.Relative path : Relative to the current path.
Asked by: Interview Candidate | Asked on: Mar 6th, 2005
Showing Answers 1 - 9 of 9 Answers
siva

Answered On : Sep 25th, 2005

absolute path is from home directory to user directory..

but

relative path is from present working directory to user directory..

bye

-Siva

  
Login to rate this answer.
raki_ch

Answered On : Nov 4th, 2005

View all answers by raki_ch

Ex:

Say, your current working directory is /home/rama

If there is sub-dir called scripts here, then

the absolute path for the sub-dir is /home/rama/scripts

and

relative path is scripts or ./scripts (relative to /home/rama)

Yes  2 Users have rated as useful.
  
Login to rate this answer.
umesh

Answered On : Feb 15th, 2006

Absolute path is a complete path, which starts from /.

relative path is the path relative to current working directory

  
Login to rate this answer.

absolute path describes the path traversed from home directory ie /homerelative path describes the path traversed from current working directory ie /.

  
Login to rate this answer.
vel

Answered On : Feb 6th, 2007

absolute path= main directory(say eg: YOU is a main directory )relative path=YOU / ME(here ME is sub-directory)

  
Login to rate this answer.
jubcheng

Answered On : Dec 17th, 2007

View all answers by jubcheng

Hi.

I have a folder icon with the following code and path inside the desktop.ini inside the folder:

[ViewState]
Mode=
Vid=
FolderType=Music
Logo=
[.ShellClassInfo]
IconResource=D:MusicCarlos Santanasantana.ico,0

If I now change the path to
.santana.ico,0
or
.santana.ico
or even
.santana.ico

like described here the folder icon won't show anymore.

What I want to do is if the folders gets moved to another PC and the drive letter is then F"  instead of D:  or whatever drive letter there is that the folder icons still show.

Please give me a hand here.

Thanks in advance,
Cheng

  
Login to rate this answer.

A path is the general form or unique location of stored file and directories.

A path can be either relative or absolute (full path).

 

A full path or absolute path is a path that points to the same location on one file system regardless of working directory or combined path. It is usually written in reference to a root directory.

 

A relative path is the path related to the current working directory.

 

We will try to get an idea about absolute and relative path with the help of below example:

 

Suppose we have following directory:

 

/abc/def/geh/ijk

/lmn/opq/rst/

 

Above both are examples of absolute path.

Lets assume our current working directory is below:

/abc/def/geh

 

We want to change our current directory to ijk which is inside geh.

So follow the below commands

 

/abc/def/geh cd ijk

/abc/def/geh/ijk

  

So for above example / bandana is a relative path directory.

 

/abc/def/geh/ijk cd /lmn/opq/rst/

  

Example of absolute path.

 

In short full path starting from root is called absolute path and subdirectory path is called relative path.

  
Login to rate this answer.
shyam82

Answered On : Apr 21st, 2009

View all answers by shyam82

Relative path name is relative to current directory. Following notations are very heplful.
1* denotes current directory
2** denotes parent directory
Absolute path name is full path name. Each directory along the path from the root directory to the desired file is specified. Must begin with / with derectories separated by/

  
Login to rate this answer.
mmakoko

Answered On : Jul 25th, 2009

View all answers by mmakoko

Absolute path: Exact path from root directory to the target directory.

Relative path: Path for current directory to target directory.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.