I am saving modified date and file size to a text file on separate line. I am then opening the text file, reading line by line and comparing the old modified date and file size with the new one. Even though they do match, I can't for the life of me get python to agree they are the same. What am I doing wrong and how can I correct it please?
def check(movFile):
lastModified = "%s" % time.ctime(os.path.getmtime(movFile))
fileSize = "%s" % os.path.getsize(movFile)
if os.path.isfile(outFile):
checkFile = open(outFile, "r")
line = checkFile.readlines()
line0 = line[0]
line1 = line[1]
if lastModified == line0:
print "last modified are the same"
if fileSize == line1:
print "file size is the same)
and here is an example of the text file:
Mon Jul 8 12:32:16 2013
7165528
I can see that both old and new are identical printing to the shell, so not sure why python is saying they are not the same.