-
Contributing Member
Difference between stat, fstat, lstat
Can someone tell me the difference between stat, fstat, lstat. Also tell me whether it is possible to use stat() only in Linux or Unix environment or is it possible to use it even in Windows environment.
-
Contributing Member
Re: Difference between stat, fstat, lstat
As far as the working of stat with windows I am sure that it would work with windows. As far as the functionality of stat() is considered it takes the syntax as
int stat(const char *path, struct stat *buf);
The function is used to return information about a file. The file referred is pointed in path and the value is filled in buf mentioned above.
-
Contributing Member
Re: Difference between stat, fstat, lstat
Some of the diffrence between stat(),fstat() and lstat() is
For stat() and lstat() serach permission is needed in the path mentioned in the file to perform their operation but it is not so in case of fstat()
In lstat() it is possible to put symbolic link and if the mentioned object is symbolic link the path is considered fully and not the file alone as in case of stat()
fstat() performs the same functionality but by making use of the concept of file descriptors. If there is any other difference put your discussion to envisage knowledge
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules