On 10/27/2011 7:22 AM, Verklagekasper wrote:
> if not exist !filename!.%suffix% (
Note that there is a race condition here both on a single
multi-processor PC or when using multiple PC's referencing a network
shared folder. In practice you >will< wind up with two or more
PC/core's rendering the same image.
In the unix world, "mkdir" is typically used as a lock mechanism
to serialize this test since "mkdir" is serialized by the underlying
file system both on a single PC or on the PC upon which the folder is
shared:
lock() {
while ! mkdir lock
do
sleep 1
done
}
unlock() {
rm -fr lock
}
This would be used:
lock
if [ ! -f $FILENAME ]
then
touch $FILENAME
unlock
:
:
else
unlock
fi
I don't know enough windows bat syntax to translate the above to windows.
Post a reply to this message
|