What is the use of stat()?

Questions by nancyphilips   answers by nancyphilips

Showing Answers 1 - 3 of 3 Answers

Gopi K

  • Jun 21st, 2007
 

#include <sys/types.h>

#include <sys/stat.h>

int stat(const char *path, struct stat *buf);


The stat() function obtains information about the named file and

writes it to the area pointed to by the buf argument. The path

argument points to a pathname naming a file. Read, write or execute

permission of the named file is not required, but all directories

listed in the pathname leading to the file must be searchable. An

implementation that provides additional or alternate file access

control mechanisms may, under implementation-dependent conditions,

cause stat() to fail.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions