UDPFile_receiver.py
def MESSAGE_check_file_exists(self):
        ''' This function returns byte array of full message
        to be sent as request to check if file exists in the server filesystem,
        in body there is ASCII chars of the file name requested '''
        
        ## Write header
        header = self.get_empty_header(header_byte_size=self.header_size)
        header[0] = ord(str(MESSAGE_TYPES['file_request']))
        
        
        ## Write body
        # write filename
        ASCII_file_name = str(self.path_to_file)
        body = self.get_empty_body(body_byte_size=FILE_REQUEST_BODY_SIZE)#len(ASCII_file_name))
        # Iterate path to file and save the ASCII chars to array
        
        if not len(ASCII_file_name) <= FILE_REQUEST_BODY_SIZE_FILENAME_LEN: 
            print(f"ERROR: ERROR in MESSAGE_check_file_exists(), name {ASCII_file_name} len: {len(ASCII_file_name)} too long for body")
            return False
        for file_char_idx, file_char in enumerate(ASCII_file_name):
            body[file_char_idx] = ord(file_char)
        
        # Write in crc at the end of the body
        message_without_crc = np.concatenate((header, body), axis=None)
        message_with_crc = append_crc_to_message(message_without_crc)
        
        return message_with_crc
 This function returns byte array of full message
        to be sent as request to check if file exists in the server filesystem,
        in body there is ASCII chars of the file name requested 
This function returns byte array of full message
to be sent as request to check if file exists in the server filesystem,
in body there is ASCII chars of the file name requested
This function returns byte array of full message to be sent as request to check if file exists in the server filesystem in body there is ASCII chars of the file name requested
def MESSAGE_check_file_exists(self):
        header = self.get_empty_header(header_byte_size=self.header_size)
        header[0] = ord(str(MESSAGE_TYPES['file_request']))
        ASCII_file_name = str(self.path_to_file)
        body = self.get_empty_body(body_byte_size=FILE_REQUEST_BODY_SIZE)
        if not len(ASCII_file_name) <= FILE_REQUEST_BODY_SIZE_FILENAME_LEN: 
            print(f"ERROR: ERROR in MESSAGE_check_file_exists(), name {ASCII_file_name} len: {len(ASCII_file_name)} too long for body")
            return False
        for file_char_idx, file_char in enumerate(ASCII_file_name):
            body[file_char_idx] = ord(file_char)
        message_without_crc = np.concatenate((header, body), axis=None)
        message_with_crc = append_crc_to_message(message_without_crc)
        return message_with_crc
def MESSAGE_check_file_exists ( self ) : header = self . get_empty_header ( header_byte_size = self . header_size ) header [ 0 ] = ord ( str ( MESSAGE_TYPES [ 'file_request' ] ) ) ASCII_file_name = str ( self . path_to_file ) body = self . get_empty_body ( body_byte_size = FILE_REQUEST_BODY_SIZE ) if not len ( ASCII_file_name ) <= FILE_REQUEST_BODY_SIZE_FILENAME_LEN : print ( f"ERROR: ERROR in MESSAGE_check_file_exists(), name {ASCII_file_name} len: {len(ASCII_file_name)} too long for body" ) return False for file_char_idx , file_char in enumerate ( ASCII_file_name ) : body [ file_char_idx ] = ord ( file_char ) message_without_crc = np . concatenate ( ( header , body ) , axis = None ) message_with_crc = append_crc_to_message ( message_without_crc ) return message_with_crc
This function returns byte array of full message
to be sent as request to check if file exists in the server filesystem,
in body there is ASCII chars of the file name requested
This function returns byte array of full message to be sent as request to check if file exists in the server filesystem in body there is ASCII chars of the file name requested
''' This function returns byte array of full message
        to be sent as request to check if file exists in the server filesystem,
        in body there is ASCII chars of the file name requested ''' ## Write header
 ## Write body
 # write filename
 #len(ASCII_file_name))
 # Iterate path to file and save the ASCII chars to array
 # Write in crc at the end of the body

self