Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

fileutils.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * Various little file functions...
00006  *
00007  */
00008 
00009 #ifndef __FILEUTILS_H
00010 #define __FILEUTILS_H
00011 
00012 #include "wvstring.h"
00013 #include "wvstringlist.h"
00014 
00015 
00016 /**
00017  * Create a directory and any subdirectories required along the way. (Equivalent
00018  * to mkdir -p).
00019  *
00020  * The default permissions on created directories is 0700, but this can be
00021  * changed at will.
00022  */
00023 bool mkdirp(WvStringParm _dir, int create_mode = 0700);
00024 
00025 
00026 /**
00027  * Copy from src to dst preserving permissions and time stamp. This does not
00028  * preserve ownership, however.
00029  *
00030  * Two versions of this are provided. One for giving two filenames/paths, and
00031  * another for giving two starting directories and a relative path from there.
00032  */
00033 bool fcopy(WvStringParm src, WvStringParm dst);
00034 bool fcopy(WvStringParm srcdir, WvStringParm dstdir, WvStringParm relname);
00035 
00036 
00037 /**
00038  * Check whether two files have the same date/time stamp. This can be used as a
00039  * quick check whether files are unchanged / the same, though obviously it
00040  * doesn't verify that they are indeed the same file.
00041  *
00042  * Two versions are provided, one for giving two files, and another for giving
00043  * two starting directories and a relative path from there.
00044  */
00045 bool samedate(WvStringParm file1, WvStringParm file2);
00046 bool samedate(WvStringParm dir1, WvStringParm dir2, WvStringParm relname);
00047 
00048 /**
00049  * Runs fnmatch against everything in the patterns list.  We also interpret
00050  * .cvsignore-style '!' patterns, which makes us very fancy.
00051  */
00052 bool wvfnmatch(WvStringList &patterns, WvStringParm name, int flags = 0);
00053 
00054 #endif // __FILEUTILS_H

Generated on Wed Dec 15 15:08:10 2004 for WvStreams by  doxygen 1.3.9.1