c - add file to Ecos -


i'm working real time operating system ecos. need port file ( file.txt not configure file ) ecos rtos. can please give me guide line or give me way of how add file ecos.

i want create file.txt(witsh name entree) example:

address ip 192.168.1.200 broadcast 192.168.1.255 getway 192.168.1.2 ..... 

from code c, want display contents of file function "fopen":

#include <stdio.h> #include <stdlib.h> #define entree "/home/amine/ecos/ecos-on-qemu/entree" #define sortie "/home/amine/ecos/ecos-on-qemu/sortie"  int main(void) {   file *f_in, *f_out;   int c;    if ((f_in = fopen(entree,"r")) == null)     {       fprintf(stderr, "\nerreur: impossible de lire le fichier 111 %s\n",entree);       return(exit_failure);     }   if ((f_out = fopen(sortie,"w")) == null)     {       fprintf(stderr, "\nerreur: impossible d'ecrire dans le fichier 222 %s\n", \ sortie);       return(exit_failure);     }   while ((c = fgetc(f_in)) != eof)     fputc(c, f_out);     printf("copie correcte\n");     fclose(f_in);     fclose(f_out);   return(exit_success); } 

when compile code, error on ecos displayed:

erreur: impossible de lire le fichier 111 /home/amine/ecos/ecos-on-qemu/entree 

so how can add file ecos avoid error.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -