The little AWK program is indeed neat, but it goes in the broken direction (from file name to module name) not the working direction (from module name to file name). This is the whole problem: given a file name, we cannot cross-platform reliably reconstruct a module name.