From a86fe90ed0cfc9597194b7b3411cf5c8a5c39515 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 16 Jun 2010 11:34:03 +0000 Subject: [PATCH] is dir test --- src/fs/fs_file_information.c | 13 +++++++++++++ src/include/gnunet_fs_service.h | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index c04c5a56e..367061cae 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -627,6 +627,19 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, } +/** + * Test if a given entry represents a directory. + * + * @param ent check if this FI represents a directory + * @return GNUNET_YES if so, GNUNET_NO if not + */ +int +GNUNET_FS_file_information_is_directory (struct GNUNET_FS_FileInformation *ent) +{ + return ent->is_directory; +} + + /** * Create an entry for an empty directory in a publish-structure. * This function should be used by applications for which the diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 90fde35f5..a200406d5 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -1896,6 +1896,16 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, struct GNUNET_TIME_Absolute expirationTime); +/** + * Test if a given entry represents a directory. + * + * @param ent check if this FI represents a directory + * @return GNUNET_YES if so, GNUNET_NO if not + */ +int +GNUNET_FS_file_information_is_directory (struct GNUNET_FS_FileInformation *ent); + + /** * Add an entry to a directory in a publish-structure. Clients * should never modify publish structures that were passed to -- 2.25.1