Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getfullfilepath for AIX?

Status
Not open for further replies.

icecubegr

Programmer
Jul 27, 2006
26
I try to write a C program which accepts the path as a parameter. The users may type the path in many different ways, so I want to get always the full path from what they type.

At windows exists a function (is called something like getfullfilepath). Is there any similar function for AIX?

Thanks
 
The users may type the path in many different ways"?

Only one of which is correct, surely? Are you trying to parse from gobbledegook they're inputting? Sounds a tall order to me.

Any examples?

All I ask of you
Is make my wildest dreams come true
 
Example
home path is '/home/cprog'
'src' is a subdirectory in '/home/cprog'
pwd is '/gl/testenv'
'data' is a subdirectory in '/gl/testenv'

Some of the valid paths are:
/
.
../..
..
~
/home/cprog/src
~/src
/gl/testenv/data
./data
data

The number of combination is very big. They can also type a '/' character at the end that is also valid.

I think there must be a 'ready' function, otherwise I have to write something.
 
A ksh variant on this was asked a few days ago (thread52-1276104) which may be of interest. I do hope you and philipose haven't been set the same homework assignment!

Ceci n'est pas une signature
Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top