LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-15-2008, 01:14 AM   #1
Amiya Rath
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
how to get absolute path in a C program,


Hi All,

I want to give the relative path name as argument to a c or c++ program and it will return the absolute path. i am using the getcwd function.
Thanks in advance....

Amiya
 
Old 10-15-2008, 04:03 PM   #2
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, grml
Posts: 210

Rep: Reputation: 33
Do you have a code example?
 
Old 10-15-2008, 07:46 PM   #3
JWPurple
Member
 
Registered: Feb 2008
Posts: 67

Rep: Reputation: 17
You could chdir() to the relative location and then call getcwd(), or some other scheme.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Absolute path qspares Linux - Software 6 10-02-2007 03:11 AM
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 07:45 AM
tar saves absolute path warshke Linux - Software 2 03-27-2006 07:43 AM
absolute path results with ls hawkmauk Programming 12 01-16-2006 09:33 PM
relative to absolute path vishalbutte Programming 4 01-14-2006 03:17 PM


All times are GMT -5. The time now is 01:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration