![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check the directory exist | ust | Shell Programming and Scripting | 7 | 09-22-2008 05:49 PM |
| How to check directory exist on servers | weonpc | Shell Programming and Scripting | 2 | 03-06-2008 03:29 AM |
| Check if certain files exist in a directory, if not add name to a textfile | SunnyK | Shell Programming and Scripting | 1 | 02-07-2008 06:21 AM |
| how to check if directory/file exist using c/c++ | steven88 | Shell Programming and Scripting | 1 | 01-02-2006 07:45 PM |
| how to check if the file exist or not? | gusla | UNIX for Dummies Questions & Answers | 3 | 03-27-2002 07:56 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
how to check if directory/file exist using c/c++
Hi there,
how to check if directory/file exist using c/c++ under linux/unix. Thanks. Steven |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Use the stat call.
Code:
struct stat st;
if(stat("/tmp",&st) == 0)
printf(" /tmp is present\n");
|
|
#3
|
|||
|
|||
|
Thank you!
vino,
Thank you very much. Steven |
|||
| Google The UNIX and Linux Forums |