c - stat() does not work for .so files -
c - stat() does not work for .so files -
i facing issue stat() . stat() not seem working .so files. gives error
no such file or directory . why happening?
as requested paste portion of code:
int main() { char str[300]; struct stat str_buf; strcpy(str,"path/to/my/library/libfuncs.so"); if(stat(str,$str_buf)==-1) perror("stat"); .... } thus error comes stat no such file or directory
but same code works fine other files , directories. libfuncs.so generated shared library.
many ".so" files in fact symbolic links due versioning issues. might want utilize lstat() in cases, stat actual link.
the error you're getting ("no such file or directory") seems imply symbolic link pointing @ doesn't exist. in these cases stat:ing link helps, of course of study might not want do. check link's target. if path in link relative, perhaps you're executing code different directory?
c linux stat
Comments
Post a Comment