aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-07-31 04:53:40 +0000
committerGuy Harris <guy@alum.mit.edu>2000-07-31 04:53:40 +0000
commit3d20d56999e06c024135fcbc49e894b7de1f8991 (patch)
treedc6021804e6b3c195c924db6b636d48ef0724abb /util.h
parent3b56e370433391bb050fae26a0ba1495bfa23591 (diff)
Add a routine to check whether a file is a directory or not.
To test whether a file the user selected to be opened from the file selection box is really a directory (so that we can point the file selection box at it, rather than trying to open the directory as a capture file, which wouldn't work), use the routine in question. To make the GTK+ file selection box start out in the last directory from which we opened a file, use "gtk_file_selection_complete()", rather than "chdir()"ing to that directory. Those changes keep us from "chdir()"ing all over the place; that way, if Ethereal dumps core, the core dump shows up in the directory from which it was run, rather than in the directory from which you last opened or into which you last saved a file. svn path=/trunk/; revision=2190
Diffstat (limited to 'util.h')
-rw-r--r--util.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/util.h b/util.h
index cbc247cee1..838718626c 100644
--- a/util.h
+++ b/util.h
@@ -1,7 +1,7 @@
/* util.h
* Utility definitions
*
- * $Id: util.h,v 1.19 2000/02/22 07:07:47 guy Exp $
+ * $Id: util.h,v 1.20 2000/07/31 04:53:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -31,6 +31,19 @@ extern "C" {
#endif /* __cplusplus */
/*
+ * Given a pathname, return:
+ *
+ * the errno, if an attempt to "stat()" the file fails;
+ *
+ * EISDIR, if the attempt succeeded and the file turned out
+ * to be a directory;
+ *
+ * 0, if the attempt succeeded and the file turned out not
+ * to be a directory.
+ */
+int test_for_directory(const char *);
+
+/*
* Given a pathname, return the last component.
*/
char *get_basename(char *);