summaryrefslogtreecommitdiff
path: root/epan/filesystem.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-02-15 21:47:57 +0000
committerGuy Harris <guy@alum.mit.edu>2009-02-15 21:47:57 +0000
commitace4af44fc2aecc93c7663f6f27b8deaae5c2a72 (patch)
treeab9611fe056fd19c3674191f606c15790b40380c /epan/filesystem.h
parent8f2e6281c19dbda07c8ee2d7a7f4c3954480f632 (diff)
downloadwireshark-ace4af44fc2aecc93c7663f6f27b8deaae5c2a72.tar.gz
Add a routine to report write errors to the list of failure-reporting
routines handled by epan/report_err.c. Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to copy_file_binary_mode() (to clarify that it *can* copy text files; arguably, *all* files are "binary" unless you're on, say, an IBM 1401 :-)). Have it use the report_err.c routines, so it works in console-mode programs. Clean up some comments while we're at it. svn path=/trunk/; revision=27456
Diffstat (limited to 'epan/filesystem.h')
-rw-r--r--epan/filesystem.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/epan/filesystem.h b/epan/filesystem.h
index b8dba0fcd5..a97f8d7880 100644
--- a/epan/filesystem.h
+++ b/epan/filesystem.h
@@ -234,10 +234,22 @@ extern gboolean deletefile (const char *path);
extern gboolean file_exists(const char *fname);
/*
- * Check, if two filenames are identical (with absolute and relative paths).
+ * Check if two filenames are identical (with absolute and relative paths).
*/
extern gboolean files_identical(const char *fname1, const char *fname2);
+/*
+ * Copy a file in binary mode, for those operating systems that care about
+ * such things. This should be OK for all files, even text files, as
+ * we'll copy the raw bytes, and we don't look at the bytes as we copy
+ * them.
+ *
+ * Returns TRUE on success, FALSE on failure. If a failure, it also
+ * displays a simple dialog window with the error message.
+ */
+extern gboolean copy_file_binary_mode(const char *from_filename,
+ const char *to_filename);
+
#ifdef _WIN32
/*
* utf8 version of getenv, needed to get win32 filename paths