change FILENAME_MAX to PATH_MAX