creating a true mutex for exclusive acces

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
OperatorGK
Posts: 66
Joined: 13 Jan 2015 06:55

Re: creating a true mutex for exclusive acces

#46 Post by OperatorGK » 11 Jul 2015 12:39

Ed Dyreen wrote:
OperatorGK wrote:Library including itself by changing the original environment?
I'm developing a similar library, but I'm doing it the other way. My solution is remove the string "call library" and place the actual function library text at the end of batch file using (goto) 2>nul GetCaller trick + on-fly batch file modification. But now it don't work with each other really well :(. This way has it own pros and cons:
+ Fast including
+ Allows using call :function syntax instead of macros
+ Easily modifiable
- Updating it to all batch files is pain :(
- General call slowness

BTW. I'm from Russia, so I'll use GOST R 34.10-2012 if I'll need to cipher something really important and government-related.
What I didn't mention is that when the macro definition is updated, the library detects the cache is different from the definition and performs a unitTest. So manual unitTesting is no longer required. The unitTest must succeed or script execution is suspended until the error is resolved.

I can see what u mean, the good news is that the (goto) trick is not required to get it to work like that. I've done similar in the past by scanning for macro's and functions and appending them.

(goto) is only needed for cosmetical uses, specifically for this:

Code: Select all

import mylib.bat

instead of this:

Code: Select all

import mylib.bat %0

I've done the test "%0" version, but this syntax is long, annoying and unlogical. Also, it takes a long time to write string-safe code, so test prototype need reworking.
Also, when you'll finish your batch unit test system, will you publish it? Cuz if there are string-safety testing functions, I'll be very happy.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: creating a true mutex for exclusive acces

#47 Post by Ed Dyreen » 12 Feb 2016 19:44

OperatorGK wrote:Also, when you'll finish your batch unit test system, will you publish it? Cuz if there are string-safety testing functions, I'll be very happy.
lolz this topic is OLD and I forgot to ever reply. I released it long time ago and then I took it off-line again.

I am currently tweaking everything and writing a batch program that will create static HTML pages for my website. I only am doing it to allow others gain some insight in how things could work which I try to explain on my site.

Writing good tutorials is a lot harder than I imagined, I don't mean the technical part, I mean where will I start, will people understand me, am I going too fast, these sort of things. It is a lot of work and I have to do it all alone, I have to because others won't do it the way I want.

You will not find me posting these codes here. I am always hesitant doing that ( tooComplex ) I just explain concepts and findings. If you can be very specific I can explain what I know and show the solutions I came up with if any.

Post Reply