Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Remote program execution(Read file on target error)
Remote program execution [message #1827843] Mon, 25 May 2020 12:22
Yves LEDUC is currently offline Yves LEDUCFriend
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
Previous Topic:New Launch Configuration
Next Topic:Editor havyly blinking on ubuntu
Goto Forum:
  


Current Time: Thu Apr 25 08:12:22 GMT 2024

Powered by FUDForum. Page generated in 0.02871 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top