Implementing execute function to determine whether the file executable or not