Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: The process cannot access the file because it is being used by another process?

by graff (Chancellor)
on Apr 28, 2016 at 02:21 UTC ( [id://1161719]=note: print w/replies, xml ) Need Help??


in reply to The process cannot access the file because it is being used by another process?[Problem disappeared!]

I'm afraid I don't understand what you gain by having 2.4 million lines of data attached as part of the perl script. Have you really not tried putting those first 13 lines into a separate file, so that the 2.4 million lines of data can sit alone (without the script attached) in a separate file, which your separate perl script then reads "in the normal way"?

Apart from that, it wouldn't surprise me to learn that a "modern" windows OS is still having (or making) trouble when more than one process wants to open the same file, and one of those processes wants write access on the file.

(Have you tried putting print "starting now\n"; as the 3rd line, to see if you get any output at all before the error message?)

  • Comment on Re: The process cannot access the file because it is being used by another process?
  • Download Code

Replies are listed 'Best First'.
Re^2: The process cannot access the file because it is being used by another process?
by BrowserUk (Patriarch) on Apr 28, 2016 at 02:53 UTC
    Have you really not tried putting those first 13 lines into a separate file, ...

    Of course, that exactly what I did. I posted the error because I've never encountered it before and wondered if anyone knew what caused it.

    As for the why. Why do you ever put DATA in a script? Same reasons apply.

    For the specifics of this occasion. I'd just copied the data out of another much bigger file with mixed content -- rather than write what would be a moderately complex parser -- to see what if any sense I could make of it. It was sat in the paste buffer when I opened a new file in my editor to write my scratch script and thought, why bother with a separate file...

    Then the error occurred and the rest you see here.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1161719]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-19 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found