Thread overview
Weird error message.
Aug 16, 2015
Warwick
Aug 17, 2015
Jonathan M Davis
Aug 17, 2015
BBasile
Aug 17, 2015
Kagamin
Aug 18, 2015
Warwick
Aug 17, 2015
Kagamin
August 16, 2015
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?
August 17, 2015
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

August 17, 2015
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).



August 17, 2015
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 :)
August 17, 2015
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.
August 18, 2015
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,