Thanks for your reply!
I have tried performing a search & replace on the path backslashes and that still is returning a False value. If I hard code a string and try the aqFile.exists() on it - it works... :( (see examples below)
The problem arises when getting the path & filename from my info dialog. Here is what is in the error log:
Check_File_Status :: File Status NOT Correct : |C:\Users\username\Documents\Compass for SW\Jess-js3003_2019-09-27_11-07.pdf| : False : should be True
Here is my function :
def Check_File_Exists(file_path_name, expected_status=True):
# params : file_path_name : string = the file|path|drive to check
# expected_status : boolean = the status the file should be
file_status = aqFile.Exists(file_path_name) # check to see if file exists
# file_status = aqFileSystem.Exists(file_path_name)
retVal = file_status == expected_status # return the comparison status
if not retVal:
Log.Warning("Check_File_Status :: File Status NOT Correct : |%s| : %s : should be %s" % (file_path_name, file_status, expected_status))
return retVal
Running the hard-coded value works :
def Test1():
the_file = 'C:\\Users\\username\\Documents\\Compass for SW\\Instrument_Reports\\Jess-js3003_2019-09-27_11-07.pdf'
status = CommonUnit.Check_File_Exists(the_file, True)
Log.Message("file status = %s" % status)
Anything else you can suggest??
Steve