Explain how an operating system uses a hierarchical directory structure to resolve file naming conflicts and to locate specific files.