Home » U++ Library support » FileSel&FileList, Path » FindFile Problem
FindFile Problem [message #16863] |
Thu, 17 July 2008 19:19  |
masu
Messages: 378 Registered: February 2006
|
Senior Member |
|
|
What is wrong with this code?
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN {
Vector<String> cmd = CommandLine();
String dirName = cmd.At(0);
FindFile ff(dirName);
String fileName;
size_t fileSize;
do {
fileName = GetFileDirectory(dirName) + ff.GetName();
if (ff.IsDirectory()) {
LOG("Directory:\t" << fileName);
Cout() << "Directory:\t" << fileName;
} else {
LOG("File:\t" << fileName);
Cout() << "File:\t" << fileName << "\n";
if (!f.Open(fileName)) {
Cout() << "ERROR: Cannot open file " << fileName << "!\n";
exit(-1);
}
fileSize = f.GetSize();
LOG("Size:\t" << fileSize);
Cout() << "Size:\t" << fileSize << "\n";
}
} while(ff.Next());
}
I only get the first directory or file with the command line argument: c:\temp\*.
WinXP, 806.r125
Matthias
|
|
|
|
|
Goto Forum:
Current Time: Sun May 11 14:32:19 CEST 2025
Total time taken to generate the page: 0.03449 seconds
|