PHP Rename() 在 Windows 中删除所有者属性?
我正在使用 PHP 的 rename
函数,我注意到它删除了 Windows 中的 OWNER 属性。
有谁知道如何克服这个问题?我需要保留文件以前的属性和权限。
感谢任何可以阐明这一点的人,因为 php 文档对我没有帮助。
更新
我尝试重命名的文件是 SQL Server 数据库文件。 (扩展名:.mdf 和 .ldf)。我将这些数据库与 SQL Server 分离,然后使用 PHP 重命名它们。但是,如果查看之前和之后的属性。它最初有一个 OWNER 属性,但通过 PHP 重命名后,它甚至没有 OWNER 属性!
Windows 7、SQL Server 2008、PHP 5.3.0
I am making use of PHP's rename
function and I notice it removes the attribute OWNER in windows.
Does anyone know how to over come this? I need to keep the files previous attributes as well as permissions.
Thanks to anyone that can shed some light on this as the php docs didn't help me.
Update
The files I am trying to rename are SQL Server Database files. (Extensions: .mdf and .ldf). I detach these databases from SQL Server and then I rename them with PHP. However, if the properties are viewed before and after. It initially has an attribute OWNER but then after renaming via PHP it does not even have an OWNER attribute!
Windows 7, SQL Server 2008, PHP 5.3.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
chown() 在 Windows 上工作吗?请参阅
http://www.php.net/manual/en/function.chown。 php
Does chown() work on Windows? See
http://www.php.net/manual/en/function.chown.php
我最终只使用了复制和取消链接选项,这并不理想,但现在就可以了。
I ended up just using the copy and unlink option, not ideal but it will do for now.