开发者

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

开发者 https://www.devze.com 2023-03-06 10:22 出处:网络
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

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

精彩评论

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

关注公众号