filetype() returns dir for symlinks on Windows 7

回眸只為那壹抹淺笑 提交于 2019-12-25 00:23:12

问题


Regardless of the filetype() documentation, PHP 5.4.7 returns "dir" on symlinks on Windows 7.

What's the most reliable way to detect a symlink on Windows 7?


回答1:


what does is_link() return in your case? maybe you can use that to test for links.

The provided link ( http://php.net/manual/en/function.is-link.php ) contains a workaround for Windows in the first comment. It's ugly, but I guess it does the job.



来源:https://stackoverflow.com/questions/13379645/filetype-returns-dir-for-symlinks-on-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!