Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Windows solution: Download MS TechNet::SysInternals::Handle at https://download.sysinternals.com/files/Handle.zip. Unzip into same directory as the script below, or into PATH if you want it long term

use warnings; use strict; sub ph { print `handle -nobanner -u -p $$`; # shows handle id (hex), t +ype (file), mode (rw-), and filename print `handle -nobanner -u blah`; # shows exe, pid, type, ow +ner, id (hex), filename print `handle -nobanner -s -p $$`; # shows summary of all the + different handle types open by that process print 'HIT ENTER'; <STDIN>; } local $\ = $/; print $$; ph(); open my $wr, '>', 'blah'; ph(); open my $rd, '<', 'blah'; ph(); open my $wrnul, '>', 'NUL'; open my $rdnul, '<', 'NUL'; close $wr; close $rd; ph();

It turns out I had recently (last week) had a problem with EU::MM's dmake distdir && ... && dmake realclean not being able to delete the distribution directory because something (I still don't know what) was holding the directory open. In fact, whatever it was wouldn't let me even delete it after closing all my cmd.exe and explorer.exe windows -- I had to reboot to get it. Unfortunately, my search-foo wasn't good enough last week to find handle.exe, so I didn't figure out what I'd done to hold it open. Thanks to the lsof hints in this thread, today I was able to find lsof for windows => handle.exe and the similar GUI-based TechNet::SysInternals::Process Explorer. So ++thanks for all the contributors to this thread


In reply to Re: A way to report open file handles a Perl script has open? by pryrt
in thread A way to report open file handles a Perl script has open? by nysus

Title:
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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (9)
    As of 2018-07-17 10:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















      Results (363 votes). Check out past polls.

      Notices?