efl/legacy/eio
Cedric BAIL 135a0f570a * eio: add eio_file_copy (using splice when available and
fallback to mmap/write with huge tlb when not).

That what an eio_cp would look like :

#include <Ecore.h>
#include <Eio.h>

static void
_test_progress_cb(void *data, const Eio_Progress *info)
{
   printf("%f (%zi / %zi octets)\n", info->percent, info->current, info->max);
}

static void
_test_done_cb(void *data)
{
   printf("copy done\n");
   ecore_main_loop_quit();
}

static void
_test_error_cb(int error, void *data)
{
   fprintf(stderr, "error: [%s]\n", strerror(error));
   ecore_main_loop_quit();
}

int
main(int argc, char **argv)
{
   Eio_File *cp;

   if (argc != 3)
     {
        fprintf(stderr, "eio_cp source_file destination_file\n");
        return -1;
     }

   ecore_init();
   eio_init();

   cp = eio_file_copy(argv[1], argv[2],
                      _test_progress_cb,
                      _test_done_cb,
                      _test_error_cb,
                      NULL);

   ecore_main_loop_begin();

   eio_shutdown();
   ecore_shutdown();

   return 0;
}




SVN revision: 52787
2010-09-26 21:47:48 +00:00
..
m4 * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
src * eio: add eio_file_copy (using splice when available and 2010-09-26 21:47:48 +00:00
AUTHORS Add the ability to perform standard IO operations on a file in a thread. 2010-07-28 22:12:41 +00:00
COPYING * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
ChangeLog * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
INSTALL * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
Makefile.am * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
NEWS * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
README * eio: Add an error callback, some docs and a small README. 2010-07-23 11:00:44 +00:00
autogen.sh * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00
configure.ac * eio: add eio_file_copy (using splice when available and 2010-09-26 21:47:48 +00:00
eio.pc.in * eio: please welcome our asynchronous input output library. 2010-07-22 16:08:17 +00:00

README

Enlightenment Input Output Library
==================================

This library is intended to provide non blocking IO by using thread for all
operation that may block. It depends only on eina and ecore right now. It
should integrate all the features/functions of Ecore_File that could block.

This should become one day part of what we call the EFL and be a dependence
of E17. Feel free to contribute, help is always appreciated !