开发者

How do I access a file's ( exe or dlls) owner details using perl?

I wanted to simply print out these details for a directory, and I wanted to write the script in perl, any i开发者_如何转开发nsights?


Use stat to get the UID of the file's owner and getpwuid to get the username for the ID, e.g.:

my $owner = getpwuid((stat)[4]);

Note that, if you call getpwuid in list context, it will return a list of values, the first of which is the username.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜