aboutsummaryrefslogtreecommitdiffstats
path: root/epan/filesystem.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-05-15 07:44:54 +0000
committerGuy Harris <guy@alum.mit.edu>2003-05-15 07:44:54 +0000
commite1647e4504d31f8260e23ec60c645735516060e0 (patch)
tree49ebcdcfb4b2a8c020befb29cf224778712b71b9 /epan/filesystem.c
parent86f3c38c4aef93560541c50e2f501e94802b337d (diff)
downloadwireshark-e1647e4504d31f8260e23ec60c645735516060e0.tar.gz
wireshark-e1647e4504d31f8260e23ec60c645735516060e0.tar.bz2
wireshark-e1647e4504d31f8260e23ec60c645735516060e0.zip
From Richard Urwin:
add support for a system-wide color filter file; fix a bug where "read_filters()" didn't close the file handle. Use the "get_datafile_path()" routine he added to construct the pathname of the Diameter directory, the global preferences file, and the manuf file. svn path=/trunk/; revision=7677
Diffstat (limited to 'epan/filesystem.c')
-rw-r--r--epan/filesystem.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/epan/filesystem.c b/epan/filesystem.c
index 82d412abe3..2a38b09c6d 100644
--- a/epan/filesystem.c
+++ b/epan/filesystem.c
@@ -1,7 +1,7 @@
/* filesystem.c
* Filesystem utility routines
*
- * $Id: filesystem.c,v 1.22 2003/03/26 00:34:27 guy Exp $
+ * $Id: filesystem.c,v 1.23 2003/05/15 07:44:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -601,3 +601,27 @@ get_persconffile_path(const char *filename, gboolean for_writing
return path;
}
+
+/*
+ * Construct the path name of a global configuration file, given the
+ * file name.
+ */
+char *
+get_datafile_path(const char *filename)
+{
+ char *path;
+
+ path = (gchar *) g_malloc(strlen(get_datafile_dir()) +
+ strlen(filename) + 2);
+ sprintf(path, "%s" G_DIR_SEPARATOR_S "%s", get_datafile_dir(),
+ filename);
+
+ return path;
+}
+
+/* Delete a file */
+gboolean
+deletefile(const char *path)
+{
+ return unlink(path) == 0;
+}