Remote program execution [message #1827843] |
Mon, 25 May 2020 12:22 |
Yves LEDUC Messages: 6 Registered: June 2017 |
Junior Member |
|
|
Eclipse C/C++
=============
Problem with this remote development programs.
/*
============================================================================
Name : LewisTestC.c
Author : YL
Version :
Copyright : (C) 2020 - YL
Description : Remote file project in C
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
int main(void) {
int fd;
ssize_t n;
char buf[1000];
puts("!!!Test acces clef USB!!!");
fd = open("texte.txt", O_RDWR);
if (fd>0) {
n = read(fd, buf, 1000);
printf("%d : %s", n, buf);
} else
perror("Open file error");
close(fd);
return EXIT_SUCCESS;
}
This little test program does not work, it displays in the console: Open file error: No such file or directory
While it runs normally if I launch it directly on the target (Raspberry Pi 4):
pi@raspberrypi:~/Projects/2020/C $ ./LewisTestC
!!!Test acces clef USB!!!
55 : texte.txt
Created on: 25 mai 2020
Author: yvesl
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.02871 seconds