我有一个问题-在窗口中打开文件时显示上次修改文件的人的名字。右键单击“属性”选项卡上的“详细信息”。。。我看到了所有者的行和名称,但我不知道如何从我的脚本。在
让我们查看文件的属性:
\\server\project\sequences\ttt_sRnd.v016.mb
我使用Python2.7,但我没有找到解决方案如何获得数据。。。在linux中它起作用了。但不是在窗户里。 我尝试了windows控制台。在
dir/Q-它处理本地文件
^{pr2}$但当服务器上的文件:
\\server\project\sequences\>dir /Q file.ext
21/12/2016 16:00 66,372 ... file.ext
1 File(s) 66,372 bytes
0 Dir(s) 52,561,190,912 bytes free
这很奇怪,因为在浏览器中我可以看到数据,而且它们是可用的
好吧,试试另一个实用程序subinacl.exe
它是相同的-处理本地文件而不是服务器上的文件:
C:\temp>subinacl.exe /file file.ext /display=owner
/owner =comp\user
C:\temp>subinacl.exe /file \\server\project\sequences\file.ext /display=owner
\\server\project\sequences\file.ext - CreateFile Error : 1314 A required privilege is not held by the client.
我尝试takeown
并且都是相同的-只在本地文件上工作:
C:\temp>takeown /F file.ext
SUCCESS: The file (or folder): "C:\temp\file.ext" now owned by user "COMP\user".
\\server\project\sequences\>takeown /F file.ext
ERROR: Access is denied.
它可能在windows中有其他工具? 我甚至准备自己编写这样一个工具,并从python调用它。但我不知道如何得到这些信息?告诉我如何在任何编程语言中崩溃问题?我相信在C/С++或C语言中,代码是由5行代码输出到控制台。。。如果是这样的话-有什么可以帮忙的,那么我将从python得到这个实用程序
Python2.7
尝试使用win32security库中的函数(GetFileSecurity和LookupAccountSid),您将获得有关所有者的信息
相关问题 更多 >
编程相关推荐