Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Sorting Directory Contents

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

51541[/snapback]

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"

Share this post


Link to post
Share on other sites

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"

51554[/snapback]

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[]){ ... }"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.