troubleshooting Question

Listing files in a directory and saving the filelist + mod_time ( datetime ) to a file

Avatar of firearmz
firearmzFlag for Germany asked on
.NET ProgrammingVisual C++.NETMicrosoft Development
2 Comments1 Solution238 ViewsLast Modified:
Hello,

i want to enumerate all files in a given directory and write them down along with there last mod time.

I'm struggling with the datetime to wstring / outstream conversion.

Just see the attached code.
Maybe someone can show me the code to used to implement this using a XML file.
Or is XML to slow for such an task?


with best regards,

FireArmz
using namespace System;
DateTime dt;
fstream file;
 
file.open(str_RPUFile.c_str(), ios::trunc);
 
// Enumerate all the files/subdirectories
while (true) { 
		dt.FromFileTime(FindFileData.ftLastWriteTime);
		
		if ((FindFileData.cFileName != wstring(L".")) && (FindFileData.cFileName != wstring(L".."))) {
			file << FindFileData.cFileName << L":" << dt.ToLongDateString << L":" << endl;
		}
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros