# HG changeset patch # User melunko # Date 1164683842 0 # Node ID 9f1077ae5637a1a3e5fc03b75110dbcb10ed6366 # Parent 420f3b9432db16dd85adda62fb582810d11c7111 [svn r127] Added gmyth_util_file_exists() predicate function diff -r 420f3b9432db -r 9f1077ae5637 gmyth/src/gmyth_util.c --- a/gmyth/src/gmyth_util.c Tue Nov 28 03:15:55 2006 +0000 +++ b/gmyth/src/gmyth_util.c Tue Nov 28 03:17:22 2006 +0000 @@ -163,7 +163,6 @@ gmyth_string_list_append_char_array (slist, "QUERY_CHECKFILE"); gmyth_program_info_to_string_list (program, slist); - g_debug ("XXXXXXXX List size: %d\n", gmyth_string_list_length (slist)); gmyth_socket_sendreceive_stringlist (socket, slist); diff -r 420f3b9432db -r 9f1077ae5637 gmyth/tests/compile_file_exists --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth/tests/compile_file_exists Tue Nov 28 03:17:22 2006 +0000 @@ -0,0 +1,1 @@ +gcc -o test_file_exists test_file_exists.c -DBIG_JOINS=1 -I/usr/include/mysql -I/usr/local/include/gmyth -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -L/usr/local/lib -lmysqlclient -lz -lcrypt -lnsl -lm -lgmyth -lgobject-2.0 -lglib-2.0 diff -r 420f3b9432db -r 9f1077ae5637 gmyth/tests/test_file_exists.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth/tests/test_file_exists.c Tue Nov 28 03:17:22 2006 +0000 @@ -0,0 +1,29 @@ + +#include + +#include "gmyth_util.h" +#include "gmyth_backendinfo.h" + +int +main (int args, const char **argv) +{ + const char *filename = argv[1]; + + gboolean res; + GMythBackendInfo *backend_info; + + g_type_init (); + + backend_info = gmyth_backend_info_new (); + + gmyth_backend_info_set_hostname (backend_info, "127.0.0.1"); + gmyth_backend_info_set_port (backend_info, 6543); + + g_print ("XXXXXXXX Testing if file %s exists in backend 127.0.0.1\n", filename); + + res = gmyth_util_file_exists (backend_info, filename); + + g_print ("XXXXXXXX Result is: %d\n", res); + + return 0; +}