This creates a race condition. You must wrap it in some atomical locking mechanism. Between the time you check and the time you create, even if you ask sysopen for an exclusive create, several processes may think they possess the lock at the same time.