Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have encountered a frustrating error that stops me from editing and testing a script in Windows XP SP2. I would like to know whether anyone has encountered the same thing and whether it can be fixed.

I have just re-installed Perl and restored my data as I had to get a new hard disk following the failure of my old one. The software image is provided by my company and is Windows XP service pack 2 with the latest security updates. I have installed the latest vesrion of Activestate Perl (v5.8.8).

When it comes to development, my method of working is to edit the script and then test it in a command prompt (CMD.EXE) before making changes and testing again using the same instance of the command prompt. The problem surfaced when I tried to save the changes to the script and my editor told me that the file was locked (file unavailable or readonly) by another process.

I have done a fair bit of investigation and come up with the following:

  1. The problem is limited to a script executed via the extension association. Running myscript.pl at the command line will lock the source file. If I use perl myscript.pl there is no problem.
  2. The script itself runs as expected even though the source cannot be edited.
  3. I have tested various other situations where the file association is used (E.g. running the script from Explorer) and not had a problem.
  4. The source file is locked (reported as readonly) until the CMD.exe instance is closed.
  5. The inability to edit has been verified with standard tools such as notepad and edit in order to remove the editor form the problem.

The only concludion that I can draw is that CMD.EXE is somehow holding on to the file after it has been executed in the way described.

Is anyone else able to reporoduce this issue? Although, I can work around the problem but I am finding it particularly frustrating!

cheers


In reply to command prompt locks scripts for editing by inman

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found