На стороне прибора создаю TFTP Client и пытаюсь скопировать файл с сервера.
Код
STATUS TFTP_GetFile(char *host_adr, char *targ_file_name, char *dest_file_name)
{
FILE *file;
int result;
file = open (dest_file_name, O_RDWR | O_CREAT, 0644);
result = tftpCopy (host_adr, 0, targ_file_name, "get", "ascii", file);
if (result == OK)
printf("TFTP DATA OK\n");
else
printf("TFTP DATA TRANSFER FAIL\n");
return result;
}
//в таске
TFTP_GetFile(server_ip, "C:/Users/General/Desktop/TFTP_DIR/data.txt", "test.txt");
{
FILE *file;
int result;
file = open (dest_file_name, O_RDWR | O_CREAT, 0644);
result = tftpCopy (host_adr, 0, targ_file_name, "get", "ascii", file);
if (result == OK)
printf("TFTP DATA OK\n");
else
printf("TFTP DATA TRANSFER FAIL\n");
return result;
}
//в таске
TFTP_GetFile(server_ip, "C:/Users/General/Desktop/TFTP_DIR/data.txt", "test.txt");
получаю сообщение от сервера
Цитата
Connection received from 10.0.0.10 on port 51398 [19/09 12:22:45.036]
Read request for file <C:/Users/General/Desktop/TFTP_DIR/data.txt>. Mode netascii [19/09 12:22:45.036]
File <C:\Users\General\Desktop\TFTP_DIR\data.txt> : error 123 in system call CreateFile The filename, directory name, or volume label syntax is incorrect. [19/09 12:22:45.036]
Read request for file <C:/Users/General/Desktop/TFTP_DIR/data.txt>. Mode netascii [19/09 12:22:45.036]
File <C:\Users\General\Desktop\TFTP_DIR\data.txt> : error 123 in system call CreateFile The filename, directory name, or volume label syntax is incorrect. [19/09 12:22:45.036]
В чем может быть проблема? Мне кажется что файл не создается по каким то причинам.
file = open (dest_file_name, O_RDWR | O_CREAT, 0644);