Convert F_FILE * to FILE * or file descriptor?

Discussion to talk about software related topics only.
Post Reply
Heliotopos
Posts: 27
Joined: Thu Jun 27, 2013 8:30 am

Convert F_FILE * to FILE * or file descriptor?

Post by Heliotopos »

Is it possible to convert the F_FILE * returned by the EFFS f_open() function to a FILE * or file descriptor? I'd like to use either vfprintf() with the former or ReplaceStdio() with the latter to print to my files.
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: Convert F_FILE * to FILE * or file descriptor?

Post by Jon »

Hi Heliotopos,

Unfortunately, a conversion like that isn't really an option. If you're looking to use the vfprintf() functionality with regard to format specifiers, there is an equivalent function available that's provided with our EFFS libraries, f_fprintf().

The signature is:

f_fprintf(F_FILE* fp, const char *format, ... );

Its usage can be found throughout our EFFS examples.

Kind Regards,
Jon
Heliotopos
Posts: 27
Joined: Thu Jun 27, 2013 8:30 am

Re: Convert F_FILE * to FILE * or file descriptor?

Post by Heliotopos »

Exactly what I was looking for, thanks!
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: Convert F_FILE * to FILE * or file descriptor?

Post by Jon »

Anytime! =)
Post Reply