create file if not exist otherwise open it and read pid