How to find Directory Existance

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • allavarapu
    New Member
    • Sep 2007
    • 12

    How to find Directory Existance

    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
  • arne
    Recognized Expert Contributor
    • Oct 2006
    • 315

    #2
    Originally posted by allavarapu
    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

    Comment

    • allavarapu
      New Member
      • Sep 2007
      • 12

      #3
      Hi arne
      Thanks
      divakar

      Comment

      Working...