I have written a database application using a binary file as storage. it is accessed via powershell cmdlets.
You can put information into the database using the put- and you can read information using get-.
The problem is synchronisation. What is the best way to ensure that the cmdlets don't access the file at the same time?
The put- must have exclusive access ie no other writers or readers can access the file. The get- doesn't need exclusive access or readers can access the database at the same time.
Am I best using a file based locking mechanism or a .NET based synchronisation mechanism?