void FilesFromDirectory::Process()
{
Filenames.clear();
+ SimpleFilenames.clear();
DirName = bbGetInputIn();
bool rec = bbGetInputRecursive();
- /*int nbFiles = */ Explore(DirName, rec);
+ /*int nbFiles = */ Explore(DirName, rec);
CleanFilenames( bbGetInputIn() );
bbSetOutputOut(Filenames);
bbSetOutputOutSimple(SimpleFilenames);
//assert( dirName[dirName.size()-1] == '' );
HANDLE hFile = FindFirstFile((dirName+"*").c_str(), &fileData);
-
for(BOOL b = (hFile != INVALID_HANDLE_VALUE); b;
b = FindNextFile(hFile, &fileData))
{
{
if (bbGetInputType()==1)
{
- Filenames.push_back(fileName);
- numberOfFiles++;
+ std::string temp = dirName+fileName;
+ Filenames.push_back(temp);
+ numberOfFiles++;
} // Type ALL_directories
tmpNumberOfFiles = Explore(dirName+fileName, recursive);
if ((bbGetInputType()==2)&&tmpNumberOfFiles==0)
{
- Filenames.push_back(fileName);
+ std::string temp = dirName+fileName;
+ Filenames.push_back(temp);
numberOfFiles++;
} // Type Lsast_directories
std::string tmpString;
int i,ii,sizeFilenames = Filenames.size();
+
// Cleanning paths with spaces
for (i=0; i<sizeFilenames; i++)
{
unsigned int lenghtBasePath = basePath.length();
for (i=0; i<sizeFilenames; i++)
{
+
SimpleFilenames.push_back( Filenames[i].substr( lenghtBasePath ) );
} // for i