Jul 26, 2008

Sorting Directory Contents

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming

free web hosting

Sorting Directory Contents

kvarnerexpress
Anyone know of a good way to sort a list of files if I give a path like C:\myDirectory\*.cmd that will return a sorted list of all cmd files in the directory? I don't need in a CFile object or anything like that, just a list of strings. Even all files in the directory would be fine, I can filter out non-cmd files after that.

Thanks in advance.

Reply

kristofer.hoch
QUOTE(kvarnerexpress @ Feb 17 2005, 04:18 PM)
Anyone know of a good way to sort a list of files if I give a path like C:\myDirectory\*.cmd that will return a sorted list of all cmd files in the directory? I don't need in a CFile object or anything like that, just a list of strings. Even all files in the directory would be fine, I can filter out non-cmd files after that.

Thanks in advance.
*


You can't do what you are asking unless you write a program to do it. You can use Perl pretty easily for something of this nature. You can also use C/C++ (CFile).

Do you have an idea of how you want to do this (write a program, run a windows command)?

Thanks,
-----------------
Kristofer Hoch
"TIMTOWTDI (tim-toe-dee): There is more than one way to do it -- Perl Motto"

 

 

 


Reply

kristofer.hoch
QUOTE(kristofer.hoch @ Feb 17 2005, 04:50 PM)
You can't do what you are asking unless you write a program to do it.  You can use Perl pretty easily for something of this nature.  You can also use C/C++ (CFile).

Do you have an idea of how you want to do this (write a program, run a windows command)?

Thanks,
-----------------
Kristofer Hoch
"TIMTOWTDI (tim-toe-dee):  There is more than one way to do it -- Perl Motto"
*


Hi there,
Apparently you want to use C/C++ being that you posted this in the C/C++ Programming forum! DOH! I should have looked first, but I am new at this bb stuff.

I have done something like this before, but it was several years ago. I did use the Win32 API, so I think I can reproduce it. It was done in C, not C++ so it should work with either compiler. Give me a bit of time to try to remember.

Thanks
-----------------
Kristofer Hoch
"int main(int argc, char *argv[]){ ... }"

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : sorting directory contents

  1. A Telephone Directory Source Code In C - (2)



Looking for sorting, directory, contents

Searching Video's for sorting, directory, contents
advertisement



Sorting Directory Contents



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE