Yes, I think it is quadratic. I don't claim it's practical (the original isn't practical either though), but just that the dependency on filenames isn't fundamental.
> I don't claim it's practical
Don"t interpret my comment as a complain, I was just triying to understand.
This is reposted from time to time, but I don't remember someome proposing this trick before. It's a nice idea.