I'm trying to use the TMP environment variable in a program. When I ask for
tmp = os.path.expandvars("$TMP")
I get
C:\Users\STEVE~1.COO\AppData\Local\Temp
Which contains the old-school, tilde form. A function I have no control over returns paths like
C:\Users\steve.cooper\AppData\Local\Temp\file.txt
My problem is this; I'd like to check if the file is in my temp drive, but I can't find a way to compare them. How do you tell if these two Windows directories;
C:\Users\STEVE~1.COO\AppData\Local\Temp
C:\Users\steve.cooper\AppData\Local\Temp
are the same?