473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Is there a method to read files by date modified ?


i have been using the getfiles method, but that retrieves only
alphabetically. i'd like to be able to retrieve filenames in a directory by
thier date modified.
does .net have a method for this ?
the closest i can see is to use the file system object.

thanks in advance,
Lee
Sep 29 '05 #1
3 1692

"Lee Holsenbeck" <Le***********@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...

i have been using the getfiles method, but that retrieves only
alphabetically. i'd like to be able to retrieve filenames in a directory
by
thier date modified.
does .net have a method for this ?
the closest i can see is to use the file system object.


You'll probably have to just get the FileInfo objects and sort the
collection yourself. Shouldn't be too hard.
Sep 29 '05 #2
Seems to me you could create a class implementing the "IComparer" interface,
put all your FileInfo's into an arraylist then call the
ArrayList.Sort(IComparer) method to get the work done cleanly.

Scott
"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
message news:e3**************@TK2MSFTNGP12.phx.gbl...

"Lee Holsenbeck" <Le***********@discussions.microsoft.com> wrote in
message news:CF**********************************@microsof t.com...

i have been using the getfiles method, but that retrieves only
alphabetically. i'd like to be able to retrieve filenames in a directory
by
thier date modified.
does .net have a method for this ?
the closest i can see is to use the file system object.


You'll probably have to just get the FileInfo objects and sort the
collection yourself. Shouldn't be too hard.

Sep 30 '05 #3

"Scott" <sd******@gmail.HEY_YOU.com> wrote in message
news:el**************@TK2MSFTNGP15.phx.gbl...
Seems to me you could create a class implementing the "IComparer"
interface, put all your FileInfo's into an arraylist then call the
ArrayList.Sort(IComparer) method to get the work done cleanly.


yeah, that is probably the best way to do it.
Sep 30 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
I need to monitor a bunch of files to see what is being opened, read, and closed, with no modifications being made. This is being done first on Windows machines, and later on Solaris. Looking...
6
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object...
1
by: Pierre Maricq | last post by:
Hi, I am using Win2000 and Access2000. I need to build build a macro or write a VBA in Access that would screen all files contained in a directory on my C drive (files are structrured DAT...
2
by: Vagabond Software | last post by:
I'm at a complete loss on this problem. I'm using a DataColumn Expression with the DataTable Select method to return rows matching a data. Rows are returned on my Windows XP Professional computer...
3
by: Lee Holsenbeck | last post by:
i have been using the getfiles method, but that retrieves only alphabetically. i'd like to be able to retrieve filenames in a directory by thier date modified. does .net have a method for this ?...
2
by: dermot | last post by:
hi, I'm opening a file dialog in a vb.net form. I want to show only files modified after a certain date. Is there anyway to filter for this? Thanks
5
by: JackM | last post by:
Is there a way to use PHP to read the date of a file that is uploaded into a directory and then print out that date on another page? I'm looking to have a specific file (/texts/filename.pdf)...
12
by: jonathan184 | last post by:
Hi the purpose of the script I am trying to do is to access a dir and run the ls -l command which will show the files and the modified date, no w the script is to check two files in that dir , if the...
2
by: ragazzo | last post by:
I am using this code to load files But i have problem when there is a large number of files, ( it shows nothing ) is it posible to list only files where date modified is today`s date. And show in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.