Method: Specinfra::Command::Solaris::V10::File.check_is_owned_by
- Defined in:
- lib/specinfra/command/solaris/v10/file.rb
.check_is_owned_by(file, owner) ⇒ Object
reference: perldoc.perl.org/functions/stat.html
http://www.tutorialspoint.com/perl/perl_getpwuid.htm
11 12 13 14 |
# File 'lib/specinfra/command/solaris/v10/file.rb', line 11 def check_is_owned_by(file, owner) regexp = "^#{owner}$" "perl -e 'printf \"%s\", getpwuid((stat(\"#{escape(file)}\"))[4])' | grep -- #{escape(regexp)}" end |