in reply to Re^4: How to get filesystem ownerships
in thread How to get filesystem ownerships
This works!
Thanks Mojotoad!
#!/usr/bin/perl -w use strict; $| =1; my $path = 'C:\temp'; my @lines = `"dir /Q $path"`; foreach my $line (@lines) { next unless $line =~ m|^\d+/\d+|; $line =~ s/^.{39}//; my ($owner, $file) = $line =~ /^(.{23})(.*)$/; $owner =~ s/\s*$//; $file =~ s/\s*$//; print "$owner\t$file\n"; }
Thanks Mojotoad!
|
---|
In Section
Seekers of Perl Wisdom