Linux/PHP 中的符号链接

发布于 2024-08-07 07:55:50 字数 107 浏览 2 评论 0原文

在 Linux 上使用 PHP,我可以使用 is_link() 函数来检测给定文件是否是符号链接。但是,有没有办法检测给定文件是否是任何其他符号链接的目标?

谢谢,布莱恩

Using PHP on Linux, I can just use the is_link() function to detect whether a given file is a symbolic link. However, is there a way to detect if a given file is the target of any other symbolic links?

Thanks, Brian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笨笨の傻瓜 2024-08-14 07:55:50

不。

这对于普通链接来说甚至是不可能的。

类似 Unix 的操作系统(就此而言,Windows 版本)会定期附带 cron 设置来保存文件数据库,以加快搜索速度。这样的数据库当然可以在两个方向上映射文件和链接,但它不一定会给出当前准确的结果。

No.

And this is not even possible with ordinary links.

Periodically, a Unix-like-OS (and for that matter, a Windows version) ships with cron setup to keep a database of files in order to speed up searching. Such a database certainly could map files and links in both directions but it would not necessarily give currently accurate results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文