> Hi,

Hi

> Now, the file is certainly there.  So what gives?  I eventually traced the
> problem down to PIO_win32_open, where I found this:-

No, CreateFile is okay. The problem is in languages/imcc/main.c

> According to:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/
> system_error_codes.asp
> That error code means:-
>     The process cannot access the file because it is being used by another
> process.

Or the same process tries to open one more descriptor of the file.

> Then it works.  However, I suspect that isn't the solution, as the file
> must be being opened somewhere twice

Yup. That's what's going on as a matter of fact.

> I've attached the change I did as a patch on the off-chance you want to
> apply it, although I'm still not convinced it's the real solution.  :-)

IMHO, a solution  might be

Index: languages/imcc/main.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/main.c,v
retrieving revision 1.46
diff -u -r1.46 main.c
--- languages/imcc/main.c       3 Sep 2003 11:42:43 -0000       1.46
+++ languages/imcc/main.c       7 Sep 2003 22:31:35 -0000
@@ -449,11 +449,11 @@
             info(interpreter, 1,"\n");
     }
     if (run_pbc == 2) {
+        fclose(yyin);
         pf = Parrot_readbc(interpreter, sourcefile);
         if (!pf)
             fatal(1, "main", "Packfile loading failed\n");
         Parrot_loadbc(interpreter, pf);
-        fclose(yyin);
     }
     else {
         int per_pbc = write_pbc | run_pbc;




Reply via email to