implemented a cached version of base file name generation to avoid strlen and strrchr at runtime