By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,833 Members | 1,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,833 IT Pros & Developers. It's quick & easy.

How to find Directory Existance

P: 12
Hi All,

How can we found whether directory or/and file existed in linux filesystem . In shell script to check file existance : if[-f $fname] and Directory existance using if[-d $dname] . Than how can we check using system call, please specify the name.
Thanks
Allavarapu
Oct 17 '07 #1
Share this Question
Share on Google+
2 Replies

arne
Expert 100+
P: 315
Hi All,

How can we found whether directory or/and file existed in linux filesystem . In shell script to check file existance : if[-f $fname] and Directory existance using if[-d $dname] . Than how can we check using system call, please specify the name.
Thanks
Allavarapu
Does stat(2) do what you need?

HTH,
arne
Oct 17 '07 #2

P: 12
Hi arne
Thanks
divakar
Oct 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.