version 1.62.2.1, 2005/12/30 22:01:01
|
version 1.62.2.3, 2006/03/17 21:40:48
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
#include "FileSystem.h" | #include "FileSystem.h" |
#include "Dir.h" | #include "Dir.h" |
| |
#if defined(PEGASUS_OS_TYPE_WINDOWS) |
|
#define DIR_SEP "\\" |
|
#else |
|
#define DIR_SEP "/" |
|
#endif |
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
// Clone the path as a C String but discard trailing slash if any: | // Clone the path as a C String but discard trailing slash if any: |
|
|
for (Uint32 i = 0, n = fileList.size(); i < n; i++) | for (Uint32 i = 0, n = fileList.size(); i < n; i++) |
{ | { |
String newPath = path; // extend path to subdir | String newPath = path; // extend path to subdir |
newPath.append(DIR_SEP); |
newPath.append("/"); |
newPath.append(fileList[i]); | newPath.append(fileList[i]); |
| |
if (FileSystem::isDirectory(newPath)) | if (FileSystem::isDirectory(newPath)) |
|
|
} | } |
path = tempPath.subString(0, pos); | path = tempPath.subString(0, pos); |
tempPath.remove(0,pos+token); | tempPath.remove(0,pos+token); |
if (FileSystem::exists( path + DIR_SEP + filename) == true) { |
if (FileSystem::exists( path + "/" + filename) == true) { |
root = path + DIR_SEP + filename; |
root = path + "/" + filename; |
break; | break; |
} else | } else |
{ | { |