the first one is because of the magic that windows uses for the "My Documents" and similar folders -- junctions. I have a couple links that I store in my scratchpad about junctions: Re^3: how to handle the warnings in a find statement and <JUNCTION>; how to recognize ... And the code that is in the private repo link (sorry, that's there for my benefit, not anyone else's) can be found in the spoiler. Please note: I make no guarantees about this code.

edit: I guess I didn't say how you should update your code... when I was exploring junctions the end of last year, it was to get rid of a similar error in my backup-from-pc-to-NAS script that I run at home; basically, I just check beforehand if the path is a junction (using either isjunc or is_junction -- I forget which I chose, and I'm not at home right now to check), and if it is, I don't try to process that folder. (IIRC, "My Documents" is really "Documents", so when it follows the real one, everything works okay; but that's a bit vague. I may look things up when I get home.) /edit

for the second question, use the LIST version of system(). If you want your script to continue without waiting for notepad++, use the system(1,...) syntax mentioned in perlport: perl -e "my $f='readme.txt'; system(1, 'c:\usr\local\apps\notepad++\notepad++.exe', $f)"


In reply to Re: getting a few simple scripts to work on windows by pryrt
in thread getting a few simple scripts to work on windows by Aldebaran

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, details, 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, summary, 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.