[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] Point directly to a file in the memory
mmap() is the normal way to do this but it looks like there are some caveats
with uclinux: http://www.linuxjournal.com/article/7221
Paul
Quoting Arnaud Lagger <arnaud.lagger@xxxxxxx>:
> Hello everybody,
>
> I'm writing an user program which takes a file and then send it to a
> function. Currently, I'm first reading the file and put it in a buffer
> so I can give the pointer to the buffer.
> But as the file is in the uClinux image, it is already in the memory, so
> is it possible to point directly to the file (thus avoiding to use a
> buffer)?
>
> I tried something like this:
>
> FILE *fp; /* file pointer */
>
> if ((fp = fopen("myfile", "rb"))==NULL){
> printf("Cannot open file \n\r");
> exit(1);
> }
>
> and then pass fp to my function but I am not reading the content of the
> file...
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/