+int kfile_printf(struct KFile *fd, const char *format, ...)
+{
+ va_list ap;
+ int len;
+
+ va_start(ap, format);
+ len = _formatted_write(format, (void (*)(char, void *))kfile_putc, fd, ap);
+ va_end(ap);
+
+ return len;
+}
+#endif /* CONFIG_PRINTF */
+
+/**
+ * Write a string to kfile \a fd.
+ * \return 0 if OK, EOF in case of error.
+ */
+int kfile_print(struct KFile *fd, const char *s)
+{
+ while (*s)
+ {
+ if (kfile_putc(*s++, fd) == EOF)
+ return EOF;
+ }
+ return 0;
+}
+
+#if CONFIG_KFILE_GETS
+/**
+ * Read a line long at most as size and put it
+ * in buf.
+ * \return number of chars read or EOF in case
+ * of error.
+ */
+int kfile_gets(struct KFile *fd, char *buf, int size)
+{
+ return kfile_gets_echo(fd, buf, size, false);
+}
+
+
+/**
+ * Read a line long at most as size and put it
+ * in buf, with optional echo.
+ *
+ * \return number of chars read, or EOF in case
+ * of error.
+ */
+int kfile_gets_echo(struct KFile *fd, char *buf, int size, bool echo)
+{
+ int i = 0;
+ int c;
+
+ for (;;)
+ {
+ if ((c = kfile_getc(fd)) == EOF)
+ {
+ buf[i] = '\0';
+ return -1;
+ }
+
+ /* FIXME */
+ if (c == '\r' || c == '\n' || i >= size-1)
+ {
+ buf[i] = '\0';
+ if (echo)
+ kfile_print(fd, "\r\n");
+ break;
+ }
+ buf[i++] = c;
+ if (echo)
+ kfile_putc(c, fd);
+ }
+
+ return i;
+}
+#endif /* !CONFIG_KFILE_GETS */
+
+
+/**
+ * Move \a fd file seek position of \a offset bytes from \a whence.
+ *
+ * This is a generic implementation of seek function, you can redefine
+ * it in your local module if needed.
+ */
+kfile_off_t kfile_genericSeek(struct KFile *fd, kfile_off_t offset, KSeekMode whence)