I have a text file that has a frequently-changing list of filenames in it.
exampleList.txt :
I want to return True if the list exactly matches the files in a given directory.
I want to return False if the directory contains files that are not in the list, and also if it only contains some but not all of the files in the list.
I know how to read the contents of the file into a variable, and I know how to read the directory listing into a variable. I know how to compare individual directory entries against the list, but no idea about comparing the entire directory listing at once against the textfile list. I've spent a stupidly huge amount of time on this already and I'm about ready to give up. Grr.
exampleList.txt :
Code:
fee.doc fye.doc foe.doc fum.doc ftangftang_ole_biscuitbarrel.doc
I want to return False if the directory contains files that are not in the list, and also if it only contains some but not all of the files in the list.
I know how to read the contents of the file into a variable, and I know how to read the directory listing into a variable. I know how to compare individual directory entries against the list, but no idea about comparing the entire directory listing at once against the textfile list. I've spent a stupidly huge amount of time on this already and I'm about ready to give up. Grr.
Comment