Can some1 pls answer me if there is any function of how to check if a path exists or not?
That is for example passing a function "/tmp" will show that it exists, however passign it "/gg" will fail if it does not exist....
Thanks
This is a discussion on Checking if a path exists within the Linux Programming forums, part of the Platform Specific Boards category; Can some1 pls answer me if there is any function of how to check if a path exists or not? ...
Can some1 pls answer me if there is any function of how to check if a path exists or not?
That is for example passing a function "/tmp" will show that it exists, however passign it "/gg" will fail if it does not exist....
Thanks
See if opendir() fails to open it - for directories
Or maybe fopen() for files.
Or use the fstat() function...
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
sorted it out... thx salem
You may also want to consider access().