www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Weird error message.

reply "Warwick" <warwick warwick.com> writes:
Dont know what to make of this, I pretty much get it every other 
time I call rdmd. It'll alternate between running fine and then 
giving me this error...

C:\Program Files (x86)\Notepad++>rdmd J:\Code\statproc.d
std.process.ProcessException std\process.d(550): Failed to spawn 
new process (The process cannot access the file because
  it is being used by another process.)
----------------
0x00434C59
0x00426F47
0x00403C9C
0x00403D17
0x0042F60B
0x0042F521
0x0042258C
0x76B533CA in BaseThreadInitThunk
0x775A9ED2 in RtlInitializeExceptionChain
0x775A9EA5 in RtlInitializeExceptionChain

Any ideas?
Aug 16 2015
next sibling parent reply Jonathan M Davis via Digitalmars-d-learn writes:
On Sunday, August 16, 2015 21:32:08 Warwick via Digitalmars-d-learn wrote:
 Dont know what to make of this, I pretty much get it every other
 time I call rdmd. It'll alternate between running fine and then
 giving me this error...

 C:\Program Files (x86)\Notepad++>rdmd J:\Code\statproc.d
 std.process.ProcessException std\process.d(550): Failed to spawn
 new process (The process cannot access the file because
   it is being used by another process.)
 ----------------
 0x00434C59
 0x00426F47
 0x00403C9C
 0x00403D17
 0x0042F60B
 0x0042F521
 0x0042258C
 0x76B533CA in BaseThreadInitThunk
 0x775A9ED2 in RtlInitializeExceptionChain
 0x775A9EA5 in RtlInitializeExceptionChain

 Any ideas?
Well, Windows has file locks, so tyically, if one program has a file open, another can't have it open. So, I'd guess that either something has the file open when you're running rdmd, so rdmd can't access it, or rdmd is trying to access it from multiple processes and sometimes one of its processes is accessing it when another one tries to. But I don't know if rdmd creates multiple processes or not. Personally, I wish that Windows didn't have file locks... :( - Jonathan M Davis
Aug 16 2015
parent reply "BBasile" <bb.temp gmx.com> writes:
On Monday, 17 August 2015 at 00:00:11 UTC, Jonathan M Davis wrote:
 On Sunday, August 16, 2015 21:32:08 Warwick via 
 Digitalmars-d-learn wrote:
 Dont know what to make of this, I pretty much get it every 
 other time I call rdmd. It'll alternate between running fine 
 and then giving me this error...

 C:\Program Files (x86)\Notepad++>rdmd J:\Code\statproc.d
 std.process.ProcessException std\process.d(550): Failed to 
 spawn
 new process (The process cannot access the file because
   it is being used by another process.)
 [...]
 Any ideas?
Well, Windows has file locks, so tyically, if one program has a [...] Personally, I wish that Windows didn't have file locks... :(
It's locked unless it's specified during the call to `CreateFile()` that the file can be shared for reading/writing (FILE_SHARE_READ / FILE_SHARE_WRITE).
Aug 16 2015
parent reply "Kagamin" <spam here.lot> writes:
On Monday, 17 August 2015 at 03:14:24 UTC, BBasile wrote:
 It's locked unless it's specified during the call to 
 `CreateFile()` that the file can be shared for reading/writing 
 (FILE_SHARE_READ / FILE_SHARE_WRITE).
And the executable file being run must not be shared for writing, because it's mapped.
Aug 17 2015
parent "Warwick" <warwick warwick.com> writes:
Decided to do a fresh install of windows, and problem has one 
away. It seems no matter how careful you are to keep your system 
lean and clean windows eventually starts grinding gears.

Thanks,
Aug 18 2015
prev sibling parent "Kagamin" <spam here.lot> writes:
On Sunday, 16 August 2015 at 21:32:10 UTC, Warwick wrote:
 Dont know what to make of this, I pretty much get it every 
 other time I call rdmd. It'll alternate between running fine 
 and then giving me this error...
 Any ideas?
rdmd creates an executable and runs it immediately. If you have an antivirus, it may not complete its job in this rather short timeframe. Just run it again, AFAIK, rdmd caches the executable from the last compilation. On Monday, 17 August 2015 at 00:00:11 UTC, Jonathan M Davis wrote:
 Personally, I wish that Windows didn't have file locks... :(
My guess, it's the executable file, which is opened by another process, if it's not completely written, running it would give even more funny results :)
Aug 17 2015