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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix system call for file directories

Status
Not open for further replies.

paulsowden

Programmer
Nov 4, 2002
10
US
Is there a system call to check whether a specified directory is a decendent to another directory? I'm moving around a directory using chdir and i need to make sure i stay within the realms of a particular sub tree. Any ideas?

Cheers
Paul
 
There are directory primitives opendir, readdir and closedir. If you traverse them by either going down the children or going to "..", you could find out if one is the child of another.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top