• C

Read a file following $PATH

How do I read a file following $PATH if it is not in current directory. I mean, are there methods to easily do that instead of dissecting $PATH string and try to find the file directory by directory? Thanks!
paiAsked:
Who is Participating?
 
rbrConnect With a Mentor Commented:
Send an email to rbr@tip-informatik.at
and I will send you an example.
0
 
paiAuthor Commented:
Adjusted points from 50 to 100
0
 
rbrCommented:
For which OS. There are no ansi function which will do this. The POSIc function for these are

opendir, readdir, scandir, closedir, ...
0
 
paiAuthor Commented:
Sorry, I forgot to mention it is in Linux. Could you give an outlined example as how it works?
0
 
paiAuthor Commented:
The answer is good. You should post it here.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.