Nguyễn Linh Trang
New member
What is the difference between stat and fstat?
Answer
Difference: Whenever the file name is a symbolic link, stat() returns the attributes or inode information about the target file associated with the link. Whereas, lstat() return the attributes of only the link. … fstat() is identical to stat(), except that the file to be stat-ed is specified by the file descriptor fd.
Answer
Difference: Whenever the file name is a symbolic link, stat() returns the attributes or inode information about the target file associated with the link. Whereas, lstat() return the attributes of only the link. … fstat() is identical to stat(), except that the file to be stat-ed is specified by the file descriptor fd.