How do I retrieve a list of files from a particular folder? I browsed
through the WINAPI Class but did not find any.
Thank you
FileName fileName;
int fileHandle;
;
// Get first file in directory
[fileHandle, fileName] = WinAPI::findFirstFile(strFmt("%1\\%2",
filePath, conPeek(fileFilter, 1)));
// While files found
while(fileName)
{
// ------------------------------------------
// Filepath and filename are known here...
// ------------------------------------------
info(strFmt("%1%2", filePath, fileName));
// Get next file
fileName = winAPI::findNextFile(fileHandle);
}
}
--
Best regards,
Patrick Bovens, MCBMSS
Pronamics Business Solutions
LinkedIn: http://www.linkedin.com/in/pbovens
Thanks a lot, it worked great !!!
Regards,
Vishal Kohli
patric wrote:
static void PBO_ListDirFiles(Args _args){ FilePath filePath =
28-Jun-07
static void PBO_ListDirFiles(Args _args)
{
FilePath filePath = "c:\\";
FileNameFilter fileFilter = ["*.*", "All files"];
FileName fileName;
int fileHandle;
;
// Get first file in directory
[fileHandle, fileName] = WinAPI::findFirstFile(strFmt("%1\\%2",
filePath, conPeek(fileFilter, 1)));
// While files found
while(fileName)
{
// ------------------------------------------
// Filepath and filename are known here...
// ------------------------------------------
info(strFmt("%1%2", filePath, fileName));
// Get next file
fileName = winAPI::findNextFile(fileHandle);
}
}
--
Best regards,
Patrick Bovens, MCBMSS
Pronamics Business Solutions
LinkedIn: http://www.linkedin.com/in/pbovens
"Anthony Calleja" wrote:
Previous Posts In This Thread:
On Thursday, June 28, 2007 5:52 AM
Anthony Callej wrote:
Retrieving a list of files in a particular folder
Hi,
How do I retrieve a list of files from a particular folder? I browsed
through the WINAPI Class but did not find any.
Thank you
On Thursday, June 28, 2007 8:26 AM
patric wrote:
static void PBO_ListDirFiles(Args _args){ FilePath filePath =
static void PBO_ListDirFiles(Args _args)
{
FilePath filePath = "c:\\";
FileNameFilter fileFilter = ["*.*", "All files"];
FileName fileName;
int fileHandle;
;
// Get first file in directory
[fileHandle, fileName] = WinAPI::findFirstFile(strFmt("%1\\%2",
filePath, conPeek(fileFilter, 1)));
// While files found
while(fileName)
{
// ------------------------------------------
// Filepath and filename are known here...
// ------------------------------------------
info(strFmt("%1%2", filePath, fileName));
// Get next file
fileName = winAPI::findNextFile(fileHandle);
}
}
--
Best regards,
Patrick Bovens, MCBMSS
Pronamics Business Solutions
LinkedIn: http://www.linkedin.com/in/pbovens
"Anthony Calleja" wrote:
On Thursday, June 28, 2007 10:54 AM
AnthonyCallej wrote:
RE: Retrieving a list of files in a particular folder
It works, Thanks :)
"pbovens" wrote:
Submitted via EggHeadCafe - Software Developer Portal of Choice
Viewing Tech-Ed 2005 Content for Non-Attendees
http://www.eggheadcafe.com/tutorials/aspnet/c58c2549-108d-4ea6-bdca-a04feac064b2/viewing-teched-2005-cont.aspx