synchronized trunk

This commit is contained in:
Guenter Obiltschnig
2007-08-10 13:57:07 +00:00
parent 2ef3a4f9d2
commit a04bae94d7
63 changed files with 2735 additions and 352 deletions

View File

@@ -1,7 +1,7 @@
//
// Glob.cpp
//
// $Id: //poco/Main/Foundation/src/Glob.cpp#6 $
// $Id: //poco/Main/Foundation/src/Glob.cpp#7 $
//
// Library: Foundation
// Package: Filesystem
@@ -219,7 +219,7 @@ void Glob::collect(const Path& pathPattern, const Path& base, const Path& curren
else
{
p.setFileName(name);
if (File(p).isDirectory())
if (isDirectory(p, (options & GLOB_FOLLOW_SYMLINKS) != 0))
{
p.makeDirectory();
files.insert(p.toString());
@@ -239,4 +239,27 @@ void Glob::collect(const Path& pathPattern, const Path& base, const Path& curren
}
bool Glob::isDirectory(const Path& path, bool followSymlink)
{
File f(path);
if (f.isDirectory())
{
return true;
}
else if (followSymlink && f.isLink())
{
try
{
// Test if link resolves to a directory.
DirectoryIterator it(f);
return true;
}
catch (Exception&)
{
}
}
return false;
}
} // namespace Poco