Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » FileSel&FileList, Path » FindFile Problem
FindFile Problem [message #16863] Thu, 17 July 2008 19:19 Go to previous message
masu is currently offline  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
 
Read Message
Read Message
Read Message
Previous Topic: FileSel ExecuteSaveAs replace file prompt bug
Next Topic: knowing extinsion and name
Goto Forum:
  


Current Time: Fri Oct 30 20:45:23 CET 2020

Total time taken to generate the page: 0.00848 seconds