Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
# Finds the owners of files on the global, finds their size, and print +s them to globalowners.txt # 7/27/01 # Prints [owner][file][file size (KB)][acess time code][last file acce +ss][modify time code][last modified date] # To effectively sort times, sort by the timecodes. # Import the text file to spreadsheet for best results # 7.30.01 added autoflush line due to overnight buffer overrun. use strict; use Win32::Perms; use File::Find; my $dir1='//server/share'; open OUT, ">dirowners.txt"; print OUT "Owner\tSize(KB)\tAccessTimeCode\tLast Accessed\tModifyTimeC +ode\tLast Modified\tFile\n"; find (\&wanted, $dir1); close OUT; sub wanted { if (-d){ my $File = new Win32::Perms("$File::Find::name")||die "$!"; + my $Own=$File->Owner(); my @stat=stat($File::Find::name); my $kbytes = $stat[7]/1024; my $access = localtime($stat[8]); my $modify = localtime($stat[9]); print OUT "$Own\t$kbytes\t$stat[8]\t$access\t$stat[9]\t$modify +\t$File::Find::name\n"; print "$Own\t$kbytes\t$stat[8]\t$access\t$stat[9]\t$modify\t$F +ile::Find::name\n"; $File->Close(); } }

In reply to Find Directory owners by OzzyOsbourne

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (7)
    As of 2021-01-16 14:42 GMT
    Find Nodes?
      Voting Booth?