C#, how to get the oldest file in a directory fast?

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-03-08T00:25:49Z Indexed on 2010/03/08 4:21 UTC
Read the original article Hit count: 251

Filed under:

I have a directory with around 15-30 thousand files. I need to just pull the oldest one. In other words the one that was created first. Is there a quick way to do this using C#, other than loading them into a collection then sorting?

Thanks

© Stack Overflow or respective owner

C#, how to get the oldest file in a directory fast?

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-03-08T00:25:49Z Indexed on 2010/03/08 0:30 UTC
Read the original article Hit count: 251

Filed under:

I have a directory with around 15-30 thousand files. I need to just pull the oldest one. In other words the one that was created first. Is there a quick way to do this using C#, other than loading them into a collection then sorting?

Thanks

© Stack Overflow or respective owner

Related posts about c#