why not bind filename:basename(File) to a variable and use that here? It would allow filename:extension/1 to do a little less work