aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-07-31 04:53:40 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-07-31 04:53:40 +0000
commit255d905d7e76e01ae15ca399737a18e15c24868c (patch)
treedc6021804e6b3c195c924db6b636d48ef0724abb /util.h
parent8ec8f8ea1afa8abe70ececc03aa5e805127e3906 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2190 f5534014-38df-0310-8fa8-9805f1628bb7
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 *);