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

fileutils.cc File Reference

#include "fileutils.h"
#include "wvfile.h"
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <utime.h>
#include <fnmatch.h>

Go to the source code of this file.

Functions

bool mkdirp (WvStringParm _dir, int create_mode)
 Create a directory and any subdirectories required along the way.

bool fcopy (WvStringParm src, WvStringParm dst)
 Copy from src to dst preserving permissions and time stamp.

bool fcopy (WvStringParm srcdir, WvStringParm dstdir, WvStringParm relname)
bool samedate (WvStringParm file1, WvStringParm file2)
 Check whether two files have the same date/time stamp.

bool samedate (WvStringParm dir1, WvStringParm dir2, WvStringParm relname)
bool wvfnmatch (WvStringList &patterns, WvStringParm name, int flags)
 Runs fnmatch against everything in the patterns list.


Function Documentation

bool fcopy WvStringParm  srcdir,
WvStringParm  dstdir,
WvStringParm  relname
 

Definition at line 76 of file fileutils.cc.

bool fcopy WvStringParm  src,
WvStringParm  dst
 

Copy from src to dst preserving permissions and time stamp.

This does not preserve ownership, however.

Two versions of this are provided. One for giving two filenames/paths, and another for giving two starting directories and a relative path from there.

Definition at line 41 of file fileutils.cc.

References WvStream::autoforward(), WvStream::callback(), WvFDStream::isok(), and WvStream::select().

bool mkdirp WvStringParm  _dir,
int  create_mode = 0700
 

Create a directory and any subdirectories required along the way.

(Equivalent to mkdir -p).

The default permissions on created directories is 0700, but this can be changed at will.

Definition at line 16 of file fileutils.cc.

References WvFastString::cstr(), and WvString::edit().

bool samedate WvStringParm  dir1,
WvStringParm  dir2,
WvStringParm  relname
 

Definition at line 98 of file fileutils.cc.

bool samedate WvStringParm  file1,
WvStringParm  file2
 

Check whether two files have the same date/time stamp.

This can be used as a quick check whether files are unchanged / the same, though obviously it doesn't verify that they are indeed the same file.

Two versions are provided, one for giving two files, and another for giving two starting directories and a relative path from there.

Definition at line 83 of file fileutils.cc.

bool wvfnmatch WvStringList patterns,
WvStringParm  name,
int  flags = 0
 

Runs fnmatch against everything in the patterns list.

We also interpret .cvsignore-style '!' patterns, which makes us very fancy.

Definition at line 107 of file fileutils.cc.


Generated on Tue Oct 5 01:09:21 2004 for WvStreams by doxygen 1.3.7