在Windows中通过PHP设置文件夹权限 [英] Setting folder permissions in Windows via PHP

查看:401
本文介绍了在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设置文件夹权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆