Esempio n. 1
0
def accessed_file(file_name):
    # type: (str) -> bool
    """ Check if the file has been accessed.

    Calls the external python library (that calls the bindings-common)
    in order to check if a file has been accessed.

    :param file_name: <String> File name.
    :return: True if accessed, False otherwise.
    """
    app_id = 0
    if __debug__:
        logger.debug("Checking if file %s has been accessed." % file_name)
    return COMPSs.accessed_file(app_id, file_name)
Esempio n. 2
0
def accessed_file(file_name):
    # type: (str) -> bool
    """ Check if the file has been accessed.

    Calls the external python library (that calls the bindings-common)
    in order to check if a file has been accessed.

    :param file_name: <String> File name.
    :return: True if accessed, False otherwise.
    """
    with event_master(ACCESSED_FILE_EVENT):
        app_id = 0
        if __debug__:
            logger.debug("Checking if file %s has been accessed." % file_name)
        if os.path.exists(file_name):
            return True
        else:
            return COMPSs.accessed_file(app_id, file_name)