在Windows中通过PHP设置文件夹权限

编程入门 行业动态 更新时间:2024-10-24 02:30:05
本文介绍了在Windows中通过PHP设置文件夹权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 有没有一种方法可以在Windows文件系统上通过PHP正确设置文件夹权限,比如授予用户A 完全访问权限,用户B 只读文件夹 \\fileserver\shares\users\A\

我似乎无法找到任何用于PHP的Windows文件系统的PHP函数

有什么想法?

chmod() 函数在Windows中可以正常工作(我刚刚测试过)。 $ b

用户A是文件所有者,用户B不是那么容易的,那么将一组权限授予用户A和对用户B授予不同的权限是很容易的。你可以使用

希望有帮助。

Is there a way to properly set folder permissions via PHP on a Windows filesystem, such as granting user A full access, and user B read-only on folder \\fileserver\shares\users\A\

I can't seem to find any PHP functions for Windows filesystems for PHP

Any ideas?

解决方案

Despite using the Unix file permission syntax, PHP's chmod() function does work in Windows (I just tested it).

If your user A was the file owner and user B wasn't then it would be easy to grant one set of permissions to user A and different permissions to user B. You can set the owner of a file using the chown() function (again, Unix-like syntax, but works with Windows, subject to your PHP program having sufficient permissions to itself to make the change).

Hope that helps.

更多推荐

在Windows中通过PHP设置文件夹权限

本文发布于:2023-11-12 11:50:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581426.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   权限   Windows   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!