Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there such a thing as a posix lstatat call?

Tags:

c++

c

linux

unix

posix

I am working on a FUSE and I have a file descriptor to the directory prior to mounting the fuse on top. I want to use that handle to read/write files with state information underneath the FUSE mounted file system, and then to be able to access that data next time I mount it. So I cannot use the normal lstat call since it won't see the files I want to access, but the files FUSE exposes instead. What I need is the equivalent of fstatat that works for symbolic links, since fstatat apparently gives the the stat info on the file the symbolic link points to, not the symbolic link itself. Yet I cannot find documentation for such a function. Does it exist? Am I thinking of an incorrect name?

like image 919
user545226 Avatar asked Nov 23 '25 06:11

user545226


1 Answers

There is no lstatat() function in POSIX. However, fstatat() takes a flag argument which can be AT_SYMLINK_NOFOLLOW, which is what you're looking for.

like image 156
user464502 Avatar answered Nov 25 '25 19:11

user464502



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!