########################################################################### # # Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file utils.py # # @author (last) LTTS # @date (last) 15-Jan-2022 # ############################################################################ import names import test import object import squish from configuration import config from builtins import int as pyInt def get_extracted_file_inp_buf(): """ This function is the handler for getting file from cloudsync folder. This handler will go inside cloudsync folder and looks for newly added input buf file based on current time. If it is satisfying that condition, it will return the exact path of newly created input buf file. @return latest_file - (string) returns latest file that append on log folder from sd-data """ try: list_of_files = glob.glob(config.CLOUD_SYNC_INP__BUF_LOCATION) latest_file = max(list_of_files, key=os.path.getctime) test.log(str(latest_file)) return str(latest_file) except: test.fail("input buf file is not created during application interaction") return False