summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/apps/misc.c b/apps/misc.c
index c378133ab2..39f17be298 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -742,35 +742,6 @@ char* strrsplt(char* str, int c)
742 return s; 742 return s;
743} 743}
744 744
745/* Test file existence, using dircache of possible */
746bool file_exists(const char *file)
747{
748 int fd;
749
750 if (!file || strlen(file) <= 0)
751 return false;
752
753#ifdef HAVE_DIRCACHE
754 if (dircache_is_enabled())
755 return (dircache_get_entry_ptr(file) != NULL);
756#endif
757
758 fd = open(file, O_RDONLY);
759 if (fd < 0)
760 return false;
761 close(fd);
762 return true;
763}
764
765bool dir_exists(const char *path)
766{
767 DIR* d = opendir(path);
768 if (!d)
769 return false;
770 closedir(d);
771 return true;
772}
773
774/* 745/*
775 * removes the extension of filename (if it doesn't start with a .) 746 * removes the extension of filename (if it doesn't start with a .)
776 * puts the result in buffer 747 * puts the result in buffer