Hi, I have an application that sometimes reports that the file does not exist, even when it does, I use os.path.exists and the file is on a mounted network share. I'm on OSX Yosemite, python 2.7.9, and I have file permissions. This is a strange thing. The first command below reports False, then I started it again, but changed one of the characters in the file name to lowercase ( TestVendorid_VerifyLog.txt), ran it again, and it reports True! Then run it again with uppercase ( TestVendorid_VerifyLog.txt) and it reports True! What's happening? This is consistent with the fact that he returns Truemost of the time, but then suddenly returns False, then I can repeat the exercise below.
>>> import os
>>> os.path.exists("/Volumes/platform-deliveries-103_1/TEST/TestVendorId.itmsp/TestVendorId_VerifyLog.txt")
False
>>> os.path.exists("/Volumes/platform-deliveries-103_1/TEST/TestVendorId.itmsp/TestVendorid_VerifyLog.txt")
True
>>> os.path.exists("/Volumes/platform-deliveries-103_1/TEST/TestVendorId.itmsp/TestVendorId_VerifyLog.txt")
True
>>>
UPDATE 1:
When it reports True, I ran this:
>>> os.stat("/Volumes/platform-deliveries-103_1/TEST/TestVendorId.itmsp/TestVendorId_VerifyLog.txt")
posix.stat_result(st_mode=33216, st_ino=5351561660274954203, st_dev=771751953L, st_nlink=1, st_uid=504, st_gid=20, st_size=38552, st_atime=1428492003, st_mtime=1428589374, st_ctime=1428589374)
UPDATE 2:
OK, now I can repeat this, and this is definitely a cache. I delete the file TestVendorId_VerifyLog.txt on my local Mac, and then recreate the file on another workstation (this file is in a network share). Then I get False on my Mac. If I change the letter in the name of the os.path.exists command file, it seems that os.path.exists more closely look for the file and find it. So, I need the "Refresh Finder" command in python just before running the command.