本文整理汇总了C++中GNUNET_DISK_directory_remove函数的典型用法代码示例。如果您正苦于以下问题:C++ GNUNET_DISK_directory_remove函数的具体用法?C++ GNUNET_DISK_directory_remove怎么用?C++ GNUNET_DISK_directory_remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GNUNET_DISK_directory_remove函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int
main (int argc,
char *argv1[])
{
char *const argv[] = {
"test-core-api",
"-c",
"test_core_api_data.conf",
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
ok = 1;
GNUNET_log_setup ("test-core-api",
"WARNING",
NULL);
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
argv,
"test-core-api",
"nohelp",
options,
&run,
&ok);
stop_arm (&p1);
stop_arm (&p2);
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
return ok;
}
开发者ID:GNUnet,项目名称:gnunet,代码行数:31,代码来源:test_core_api.c
示例2: main
int
main (int argc, char *argv[])
{
char cfg_name[128];
char *const xargv[] = {
"test-plugin-psycstore",
"-c", cfg_name,
"-L", LOG_LEVEL,
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-plugin-psycstore-sqlite");
GNUNET_log_setup ("test-plugin-psycstore", LOG_LEVEL, NULL);
plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_plugin_psycstore_%s.conf",
plugin_name);
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"test-plugin-psycstore", "nohelp", options, &run, NULL);
if ( (0 != ok) &&
(77 != ok) )
FPRINTF (stderr, "Missed some testcases: %d\n", ok);
#if ! DEBUG_PSYCSTORE
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-plugin-psycstore-sqlite");
#endif
return ok;
}
开发者ID:GNUnet,项目名称:gnunet,代码行数:31,代码来源:test_plugin_psycstore.c
示例3: main
int
main (int argc, char *argv[])
{
char *const argvx[] = {
"test-fs-unindex",
"-c",
"test_fs_unindex_data.conf",
#if VERBOSE
"-L", "DEBUG",
#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
GNUNET_log_setup ("test_fs_unindex",
#if VERBOSE
"DEBUG",
#else
"WARNING",
#endif
NULL);
GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
"test-fs-unindex", "nohelp", options, &run, NULL);
stop_arm (&p1);
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/");
if (NULL != fn)
{
GNUNET_DISK_directory_remove (fn);
GNUNET_free (fn);
}
return 0;
}
开发者ID:h4ck3rm1k3,项目名称:gnunet-debian,代码行数:34,代码来源:test_fs_unindex.c
示例4: main
int
main (int argc, char *argv[])
{
int ret;
char *pos;
char dir_name[128];
sleep (1);
/* determine name of plugin to use */
plugin_name = argv[0];
while (NULL != (pos = strstr (plugin_name, "_")))
plugin_name = pos + 1;
if (NULL != (pos = strstr (plugin_name, ".")))
pos[0] = 0;
else
pos = (char *) plugin_name;
GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/test-gnunet-datastore-%s",
plugin_name);
GNUNET_DISK_directory_remove (dir_name);
GNUNET_log_setup ("test-datastore-api-management",
#if VERBOSE
"DEBUG",
#else
"WARNING",
#endif
NULL);
ret = check ();
if (pos != plugin_name)
pos[0] = '.';
GNUNET_DISK_directory_remove (dir_name);
return ret;
}
开发者ID:h4ck3rm1k3,项目名称:gnunet-debian,代码行数:34,代码来源:test_datastore_api_management.c
示例5: main
int
main (int argc, char *argv[])
{
int ret;
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
GNUNET_log_setup ("test-gnunet-daemon-hostlist",
"WARNING",
NULL);
#if !WINDOWS
system ("gnunet-peerinfo -s -c test_learning_adv_peer.conf > /dev/null");
system ("gnunet-peerinfo -s -c test_learning_learn_peer.conf > /dev/null");
#else
system ("gnunet-peerinfo -s -c test_learning_adv_peer.conf > NUL");
system ("gnunet-peerinfo -s -c test_learning_learn_peer.conf > NUL");
#endif
ret = check ();
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
if (GNUNET_YES == GNUNET_DISK_file_test ("hostlists_learn_peer.file"))
{
if (0 == UNLINK ("hostlists_learn_peer.file"))
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Hostlist file hostlists_learn_peer.file was removed\n");
}
return ret;
}
开发者ID:muggenhor,项目名称:GNUnet,代码行数:28,代码来源:test_gnunet_daemon_hostlist_learning.c
示例6: read_info
/**
* read the pseudonym infomation from a file
* @param cfg configuration to use
* @param nsid hash code of a pseudonym
* @param meta meta data to be read from a file
* @param ranking ranking of a pseudonym
* @param ns_name name of a pseudonym
*/
static int
read_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
const struct GNUNET_HashCode * nsid,
struct GNUNET_CONTAINER_MetaData **meta, int32_t * ranking,
char **ns_name)
{
char *fn;
char *emsg;
struct GNUNET_BIO_ReadHandle *fileR;
fn = get_data_filename (cfg, PS_METADATA_DIR, nsid);
GNUNET_assert (fn != NULL);
if (GNUNET_YES !=
GNUNET_DISK_file_test (fn))
{
GNUNET_free (fn);
return GNUNET_SYSERR;
}
fileR = GNUNET_BIO_read_open (fn);
if (fileR == NULL)
{
GNUNET_free (fn);
return GNUNET_SYSERR;
}
emsg = NULL;
*ns_name = NULL;
if ((GNUNET_OK != GNUNET_BIO_read_int32 (fileR, ranking)) ||
(GNUNET_OK !=
GNUNET_BIO_read_string (fileR, "Read string error!", ns_name, 200)) ||
(GNUNET_OK !=
GNUNET_BIO_read_meta_data (fileR, "Read meta data error!", meta)))
{
(void) GNUNET_BIO_read_close (fileR, &emsg);
GNUNET_free_non_null (emsg);
GNUNET_free_non_null (*ns_name);
*ns_name = NULL;
GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
GNUNET_free (fn);
return GNUNET_SYSERR;
}
if (GNUNET_OK != GNUNET_BIO_read_close (fileR, &emsg))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
_("Failed to parse metadata about pseudonym from file `%s': %s\n"), fn,
emsg);
GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
GNUNET_CONTAINER_meta_data_destroy (*meta);
*meta = NULL;
GNUNET_free_non_null (*ns_name);
*ns_name = NULL;
GNUNET_free_non_null (emsg);
GNUNET_free (fn);
return GNUNET_SYSERR;
}
GNUNET_free (fn);
return GNUNET_OK;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:65,代码来源:pseudonym.c
示例7: main
/**
* Main function that initializes the testbed.
*
* @param argc ignored
* @param argv ignored
* @return 0 on success
*/
int
main (int argc, char *argv[])
{
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
(void) GNUNET_TESTBED_test_run ("test_fs_test_lib",
"fs_test_lib_data.conf",
NUM_DAEMONS,
0, NULL, NULL,
&run, NULL);
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
return ret;
}
开发者ID:tg-x,项目名称:gnunet,代码行数:19,代码来源:test_fs_test_lib.c
示例8: abort_publish_task
static void
abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_FS_publish_stop (publish);
publish = NULL;
GNUNET_DISK_directory_remove (fn1);
GNUNET_free (fn1);
fn1 = NULL;
GNUNET_DISK_directory_remove (fn2);
GNUNET_free (fn2);
fn2 = NULL;
}
开发者ID:schanzen,项目名称:gnunet-mirror,代码行数:12,代码来源:test_fs_list_indexed.c
示例9: main
int
main (int argc, char *argv[])
{
int ret;
GNUNET_log_setup ("test-core-api-start-only",
"WARNING",
NULL);
ret = check ();
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
return ret;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:13,代码来源:test_core_api_start_only.c
示例10: cleanup
static void
cleanup ()
{
GNUNET_SCHEDULER_shutdown ();
if (NULL != fn1)
{
GNUNET_DISK_directory_remove (fn1);
GNUNET_free (fn1);
}
if (NULL != fn2)
{
GNUNET_DISK_directory_remove (fn2);
GNUNET_free (fn2);
}
}
开发者ID:GNUnet,项目名称:gnunet,代码行数:15,代码来源:perf_gnunet_service_fs_p2p_respect.c
示例11: main
int
main (int argc, char *const *argv)
{
if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary ("gnunet-gns-proxy"))
{
fprintf (stderr, "Proxy binary not in PATH... skipping!\n");
return 0;
}
if (GNUNET_YES != GNUNET_OS_check_helper_binary ("gnunet-helper-dns"))
{
fprintf (stderr, "DNS helper binary has wrong permissions... skipping!\n");
return 0;
}
GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_proxy.conf");
if (0 != curl_global_init (CURL_GLOBAL_WIN32))
{
fprintf (stderr, "failed to initialize curl\n");
return 2;
}
if (0 != GNUNET_TESTING_peer_run ("test-gnunet-gns-proxy",
"test_gns_proxy.conf",
&run, NULL))
return 1;
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-gns-proxy");
return global_ret;
}
开发者ID:schanzen,项目名称:gnunet-mirror,代码行数:30,代码来源:test_gns_proxy.c
示例12: test_bigstring_rw
static int
test_bigstring_rw ()
{
char *msg;
char *readResultString;
struct GNUNET_BIO_WriteHandle *fileW;
struct GNUNET_BIO_ReadHandle *fileR;
char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
fileW = GNUNET_BIO_write_open (fileName);
GNUNET_assert (NULL != fileW);
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_string (fileW, TESTSTRING));
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));
fileR = GNUNET_BIO_read_open (fileName);
GNUNET_assert (NULL != fileR);
readResultString = NULL;
GNUNET_assert (GNUNET_SYSERR ==
GNUNET_BIO_read_string (fileR, "Read string error",
&readResultString, 1));
GNUNET_assert (NULL == readResultString);
msg = NULL;
GNUNET_BIO_read_close (fileR, &msg);
GNUNET_free (msg);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
GNUNET_free (fileName);
return 0;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:28,代码来源:test_bio.c
示例13: test_bigmeta_rw
static int
test_bigmeta_rw ()
{
char *msg;
static char meta[1024 * 1024 * 10];
struct GNUNET_BIO_WriteHandle *fileW;
struct GNUNET_BIO_ReadHandle *fileR;
char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
struct GNUNET_CONTAINER_MetaData *metaDataR;
memset (meta, 'b', sizeof (meta));
meta[sizeof (meta) - 1] = '\0';
fileW = GNUNET_BIO_write_open (fileName);
GNUNET_assert (NULL != fileW);
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (fileW, sizeof (meta)));
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write (fileW, meta, sizeof (meta)));
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));
fileR = GNUNET_BIO_read_open (fileName);
GNUNET_assert (NULL != fileR);
metaDataR = NULL;
GNUNET_assert (GNUNET_SYSERR ==
GNUNET_BIO_read_meta_data (fileR, "Read meta error",
&metaDataR));
msg = NULL;
GNUNET_BIO_read_close (fileR, &msg);
GNUNET_free (msg);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
GNUNET_assert (NULL == metaDataR);
GNUNET_free (fileName);
return 0;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:32,代码来源:test_bio.c
示例14: test_fakestring_rw
static int
test_fakestring_rw ()
{
char *msg;
int32_t tmpInt = 2;
char *readResult;
struct GNUNET_BIO_WriteHandle *fileW;
struct GNUNET_BIO_ReadHandle *fileR;
char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
fileW = GNUNET_BIO_write_open (fileName);
GNUNET_assert (NULL != fileW);
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (fileW, tmpInt));
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));
fileR = GNUNET_BIO_read_open (fileName);
GNUNET_assert (NULL != fileR);
GNUNET_assert (GNUNET_SYSERR ==
GNUNET_BIO_read_string (fileR, "Read string error",
&readResult, 200));
msg = NULL;
GNUNET_BIO_read_close (fileR, &msg);
GNUNET_free (msg);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
GNUNET_free (fileName);
return 0;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:27,代码来源:test_bio.c
示例15: do_stop
static void
do_stop (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
char *fn = cls;
if (0 ==
GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time,
TIMEOUT)).rel_value_us)
{
GNUNET_break (0);
ret = 1;
}
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Finished download, shutting down\n",
(unsigned long long) FILESIZE);
}
if (NULL != fn)
{
GNUNET_DISK_directory_remove (fn);
GNUNET_free (fn);
}
GNUNET_SCHEDULER_shutdown ();
}
开发者ID:tg-x,项目名称:gnunet,代码行数:26,代码来源:test_fs_test_lib.c
示例16: test_fakebigmeta_rw
static int
test_fakebigmeta_rw ()
{
char *msg;
int32_t tmpInt = 1024 * 1024 * 10;
struct GNUNET_BIO_WriteHandle *fileW;
struct GNUNET_BIO_ReadHandle *fileR;
char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
struct GNUNET_CONTAINER_MetaData *metaDataR;
fileW = GNUNET_BIO_write_open (fileName);
GNUNET_assert (NULL != fileW);
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (fileW, tmpInt));
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));
fileR = GNUNET_BIO_read_open (fileName);
GNUNET_assert (NULL != fileR);
metaDataR = NULL;
GNUNET_assert (GNUNET_SYSERR ==
GNUNET_BIO_read_meta_data (fileR, "Read meta error",
&metaDataR));
msg = NULL;
GNUNET_BIO_read_close (fileR, &msg);
GNUNET_free (msg);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
GNUNET_assert (NULL == metaDataR);
GNUNET_free (fileName);
return 0;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:29,代码来源:test_bio.c
示例17: test_nullstring_rw
static int
test_nullstring_rw ()
{
char *msg;
char *readResultString = (char *) "not null";
struct GNUNET_BIO_WriteHandle *fileW;
struct GNUNET_BIO_ReadHandle *fileR;
char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
fileW = GNUNET_BIO_write_open (fileName);
GNUNET_assert (NULL != fileW);
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_string (fileW, NULL));
GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));
fileR = GNUNET_BIO_read_open (fileName);
GNUNET_assert (NULL != fileR);
GNUNET_assert (GNUNET_OK ==
GNUNET_BIO_read_string (fileR, "Read string error",
&readResultString, 200));
GNUNET_assert (NULL == readResultString);
GNUNET_BIO_read_close (fileR, &msg);
GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
GNUNET_free (fileName);
return 0;
}
开发者ID:amatus,项目名称:gnunet-debian,代码行数:26,代码来源:test_bio.c
示例18: do_download
static void
do_download (void *cls,
const char *emsg)
{
struct DownloadContext *dc = cls;
struct GNUNET_FS_Uri *uri = dc->uri;
GNUNET_TESTBED_operation_done (op);
op = NULL;
if (NULL != dc->fn)
{
GNUNET_DISK_directory_remove (dc->fn);
GNUNET_free (dc->fn);
}
GNUNET_free (dc);
if (NULL != emsg)
{
GNUNET_SCHEDULER_shutdown ();
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to stop source daemon: %s\n",
emsg);
GNUNET_FS_uri_destroy (uri);
ok = 1;
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n",
(unsigned long long) FILESIZE);
start_time = GNUNET_TIME_absolute_get ();
GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop,
NULL);
GNUNET_FS_uri_destroy (uri);
}
开发者ID:claudiuolteanu,项目名称:gnunet-1,代码行数:31,代码来源:test_gnunet_service_fs_migration.c
示例19: main
int
main (int argc, char *argv[])
{
int ret;
GNUNET_log_setup ("test_testing_topology_churn",
"WARNING",
NULL);
ret = check ();
/**
* Need to remove base directory, subdirectories taken care
* of by the testing framework.
*/
if (test_directory != NULL)
{
if (GNUNET_DISK_directory_remove (test_directory) != GNUNET_OK)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Failed to remove testing directory %s\n", test_directory);
}
}
return ret;
}
开发者ID:h4ck3rm1k3,项目名称:gnunet-debian,代码行数:25,代码来源:test_testing_topology_churn.c
示例20: main
/**
* Main: start test
*/
int
main (int argc, char *argv[])
{
char *const argv2[] = {
argv[0],
"-c",
"test_testing_2dtorus.conf",
#if VERBOSE
"-L",
"DEBUG",
#endif
NULL
};
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Start\n");
GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
"test_testing_2dtorus",
gettext_noop ("Test testing 2d torus."), options, &run,
NULL);
#if REMOVE_DIR
GNUNET_DISK_directory_remove ("/tmp/test_testing_2dtorus");
#endif
if (GNUNET_OK != ok)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n");
return 1;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n");
return 0;
}
开发者ID:h4ck3rm1k3,项目名称:gnunet-debian,代码行数:35,代码来源:test_testing_2dtorus.c
注:本文中的GNUNET_DISK_directory_remove函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论