The STAT system call series includes Fstat, Stat, and Lstat, all of which are used to return "related file state information", except that the source file is set differently. The first introduction is a very important type of struct, named struct
Fstat, stat, and lstat usage, fstatstatlstat
The stat System Call series include fstat, stat, and lstat, which are used to return "Related File status information". The difference between the three is that the source file setting method is different.
1. Dependent header Files#include #include #include 2. Function definition:By passing in the file path, the struct stat struct pointerint stat (const char *path, struct stat *buf);Gets the properties of the file with the file descriptor. This
NOTE: Reprint please indicate the source
The specific information for the function is as follows:
function to get file information
Header file
function form
int stat (const char *path, struct stat *buf);int fstat
(1) Ordinary document (regular file): This is the most commonly used file type, this file contains some form of data, the interpretation of the contents of the file is processed by the application of the file.(2) directory file: This file contains
The stat System Call series include fstat, stat, and lstat, which are used to return "Related File status information". The difference between the three is that the source file setting method is different.
1
First, I would like to introduce a very
In the previous article, we said that the X permission for the Bdump directory was missing, resulting in an Oracle database exception.The following is the Linux strace command to track the Bdump directory when the X permission is lost, Sqlplus/as
1. Create a symbolic link
# Include Define the function int symlink (const char * oldpath, const char * newpath );Function Description symlink () uses the name specified by newpath to create a new connection (symbolic connection) to the existing
Name
Stat, fstat, lstat-Get File statusSynopsis
# Include # Include # Include
Int Stat (const char *Path, Struct stat *Buf);Int fstat (int FD, Struct stat *Buf);Int lstat (const char *Path, Struct stat *Buf);
Feature test macro requirements for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.