added a free space check after file is created
pid filename now depends on exec name