I remember elsewhere there being a discussion on batch files and "if errorlevel 1" meaning "if errorlevel >= 1" (or <=1) rather than
strictly equal, so if this is somehow a parallel execution sort of
thing, maybe there's multiple threads doing unpredictable
things because of it?
...admittedly, that last one is more than a bit of a stretch. I'm
Fresh eyes, fresh mind... This script is running 8 times in parallel..
If exist /bbs/test goto post (does test exist? If yes skip all the copying) echo > /bbs/test (well seeing as it didn't make one now)
del /bbs/test (remove the lock file when we're done)
:post
goto loop
They try and test for whether there is already a copy in progress if it isn't then create the "test" file because I'm here now. Generate the random errorlevel, yes it sets the NUM variable with each errorlevel until the errorlevel is equal to or greater than any test errorlevel. So at the end, only a single file gets copied once at a time, my first iteration of this whole idea copied every file multiple times until the errorlevel condition
was breached. This was cleaner.
Generally this lock method works, I use it in all my door batch files. So i'm not sure what the problem is here and now. Shrug...
Spec
--- SuperBBS v1.17-3 (Eval)
* Origin: < Scrawled in blood at The Lower Planes > (21:3/101)