From: Enlightenment S. <no-...@en...> - 2010-10-05 16:46:47
|
Log: * eio: add eio_dir_copy. Little example on how to use it : #include <Ecore.h> #include <Eio.h> static void _test_notify_cb(void *data, const Eio_Progress *info) { switch (info->op) { case EIO_FILE_COPY: printf("[%s] %f%%\n", info->dest, info->percent); break; case EIO_DIR_COPY: printf("global [%li/%li] %f%%\n", info->current, info->max, info->percent); break; } } 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_dir_copy(argv[1], argv[2], _test_notify_cb, _test_done_cb, _test_error_cb, NULL); ecore_main_loop_begin(); eio_shutdown(); ecore_shutdown(); return 0; } NOTE: be aware that it's your duty to provide the "right target". Meaning that copying to '.' will copy the content directly inside '.' and not in a subdirectory. Author: cedric Date: 2010-10-05 09:46:41 -0700 (Tue, 05 Oct 2010) New Revision: 53069 Added: trunk/eio/src/lib/eio_dir.c Modified: trunk/eio/src/lib/Makefile.am Modified: trunk/eio/src/lib/Makefile.am =================================================================== --- trunk/eio/src/lib/Makefile.am 2010-10-05 16:17:04 UTC (rev 53068) +++ trunk/eio/src/lib/Makefile.am 2010-10-05 16:46:41 UTC (rev 53069) @@ -12,7 +12,8 @@ libeio_la_SOURCES = \ eio_file.c \ eio_main.c \ -eio_single.c +eio_single.c \ +eio_dir.c libeio_la_LIBADD = @EIO_LIBS@ libeio_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ |