creates semaphore and file