The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-02-2006
Registered User
 

Join Date: Jan 2006
Posts: 3
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
Reply With Quote
Forum Sponsor
  #2  
Old 01-02-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,683
Use the stat call.

Code:
struct stat st;
if(stat("/tmp",&st) == 0)
        printf(" /tmp is present\n");
Reply With Quote
  #3  
Old 01-02-2006
Registered User
 

Join Date: Jan 2006
Posts: 3
Thank you!

vino,
Thank you very much.
Steven
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0