From 4634882ae5dcc0684364e9a5e4613fcaab0ce00d Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 16 Aug 2016 15:00:05 +0200 Subject: [PATCH] return owner for files on windows --- lib/train/extras/file_windows.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/train/extras/file_windows.rb b/lib/train/extras/file_windows.rb index 2278628b..e276dad8 100644 --- a/lib/train/extras/file_windows.rb +++ b/lib/train/extras/file_windows.rb @@ -51,6 +51,13 @@ def mounted nil end + def owner + owner = @backend.run_command( + "Get-Acl '#{@spath}' | select -expand Owner").stdout.strip + return if owner.empty? + owner + end + def type if attributes.include?('Archive') return :file @@ -61,7 +68,7 @@ def type end %w{ - mode owner group uid gid mtime size selinux_label + mode group uid gid mtime size selinux_label }.each do |field| define_method field.to_sym do nil