in reply to removing a needle from a haystack
Orthanc:
You don't really explain the application in enough detail to know if there might be a design change that could be made to provide the full filename. Why do you need to delete only one file? How do you find out which file to delete? How often does this come up? Could a naming convention in the directory help reduce the number of potential targets?