Solved

Read a file following $PATH

Posted on 2000-05-08
5
191 Views
Last Modified: 2010-04-15
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!
0
Comment
Question by:pai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:pai
ID: 2791136
Adjusted points from 50 to 100
0
 
LVL 10

Expert Comment

by:rbr
ID: 2791307
For which OS. There are no ansi function which will do this. The POSIc function for these are

opendir, readdir, scandir, closedir, ...
0
 

Author Comment

by:pai
ID: 2791366
Sorry, I forgot to mention it is in Linux. Could you give an outlined example as how it works?
0
 
LVL 10

Accepted Solution

by:
rbr earned 100 total points
ID: 2791406
Send an email to rbr@tip-informatik.at
and I will send you an example.
0
 

Author Comment

by:pai
ID: 2802673
The answer is good. You should post it here.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question