473,387 Members | 1,641 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,387 software developers and data experts.

File Not Accessed

I want to be able to find out the names of files that havn't been accessed
in the past X days...

so I want to do something like this..

date.today - txtlastdays.txt

9/08/2006 - 30 days = X

is this possible?
Sep 8 '06 #1
4 958
Not sure what you mean by 9/08/2006 - 30 days = X days.

It would be rather something like

MaxAccessDate=Today.AddDays(-x)

That will give the date that is x days earlier than today. You can then use
this date to filter the files you want...

See The fileInfo class if the problem is to get the last access date...

--
Patrice

"Gabe Matteson" <gmattesonATinqueryDOTbiza écrit dans le message de news:
eM**************@TK2MSFTNGP04.phx.gbl...
>I want to be able to find out the names of files that havn't been accessed
in the past X days...

so I want to do something like this..

date.today - txtlastdays.txt

9/08/2006 - 30 days = X

is this possible?

Sep 8 '06 #2
"Gabe Matteson" <gmattesonATinqueryDOTbizschrieb:
>I want to be able to find out the names of files that havn't been accessed
in the past X days...

so I want to do something like this..

date.today - txtlastdays.txt

9/08/2006 - 30 days = X

is this possible?
<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/FileSystemEnumerator.zip>

+ 'System.IO.File.GetLastAccessTime' + 'Now' + 'DateTime' ('Date').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Sep 8 '06 #3
Thanks!
It seems to add X to the days to todays date though, am i missing something?
thanks!...

Dim QueryTime As date

QueryTime = Today.AddDays(-txNotAccessed.Text)

If sFile.LastAccessTime = QueryTime Then

MsgBox(sFile)

End If





"Patrice" <sc****@chez.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Not sure what you mean by 9/08/2006 - 30 days = X days.

It would be rather something like

MaxAccessDate=Today.AddDays(-x)

That will give the date that is x days earlier than today. You can then
use this date to filter the files you want...

See The fileInfo class if the problem is to get the last access date...

--
Patrice

"Gabe Matteson" <gmattesonATinqueryDOTbiza écrit dans le message de
news: eM**************@TK2MSFTNGP04.phx.gbl...
>>I want to be able to find out the names of files that havn't been accessed
in the past X days...

so I want to do something like this..

date.today - txtlastdays.txt

9/08/2006 - 30 days = X

is this possible?


Sep 8 '06 #4
Well, to check this it would be really easy to just print out the value for
Query.

IMO the problme is rather that you are using = instead of <= that is you'll
have only files accessed exacltly x days ago.
--

"Gabe Matteson" <gmattesonATinqueryDOTbiza écrit dans le message de news:
uw****************@TK2MSFTNGP05.phx.gbl...
Thanks!
It seems to add X to the days to todays date though, am i missing
something? thanks!...

Dim QueryTime As date

QueryTime = Today.AddDays(-txNotAccessed.Text)

If sFile.LastAccessTime = QueryTime Then

MsgBox(sFile)

End If





"Patrice" <sc****@chez.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>Not sure what you mean by 9/08/2006 - 30 days = X days.

It would be rather something like

MaxAccessDate=Today.AddDays(-x)

That will give the date that is x days earlier than today. You can then
use this date to filter the files you want...

See The fileInfo class if the problem is to get the last access date...

--
Patrice

"Gabe Matteson" <gmattesonATinqueryDOTbiza écrit dans le message de
news: eM**************@TK2MSFTNGP04.phx.gbl...
>>>I want to be able to find out the names of files that havn't been
accessed in the past X days...

so I want to do something like this..

date.today - txtlastdays.txt

9/08/2006 - 30 days = X

is this possible?



Sep 11 '06 #5

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

Similar topics

3
by: John Bailo | last post by:
With OS400, all files are objects that can be accessed relationally. When I view the file system from Navigator (windows client), I see there is the Database and SQL tables, then there is the...
3
by: happy | last post by:
/* Book name : The prodessional programmers guide to C File name : E:\programs\tc\iti01\ch09\main\01setupm.c Program discription: file setuping -up -Version 01-ver01-W Logic ...
16
by: Otie | last post by:
Hi, Is there a way for VB5 to determine exactly where on a hard drive a .exe file is stored upon the .exe file's first copying to the hard drive? What I need to know is the exact hard drive...
3
by: RAMohrmann | last post by:
Greetings, I am attempting to view all files in a directory and if those files have not been modified within the last couple days I will remove them. In order to do this I need to look at the...
16
by: Eran.Yasso | last post by:
Hi, I have a mdb file shared in the LAN. I want to write app that verifies if it's open. If the file is not open, then my app can open the file. if the file is used, then the app won't open it....
10
by: Martin Arvidsson, Visual Systems AB | last post by:
Hi! I want to create an event that is fiered when a file is accessed (Opened). What i want to do is monitor a directory and subdirectory if files are opened. I have tried to use the...
2
by: hayyal | last post by:
Hi Folks, Just wanted to know few things about static variables. why static variables cannot be accessed in other files by using extern in c/c++? whats the difference between global and...
4
by: Daniel | last post by:
is there a way to detect if a user tries to access a php file? For instance, db.config.php is called in many php pages but should never actually be open directly. Is there a way to know if...
12
by: glennanthonyb | last post by:
Hi The company I work for has finally woken up to data security on our field laptops. I'm writing something in C# that will allow remote deletion of sensitive data and I don't believe...
9
by: tshad | last post by:
I am trying to get access to a file that may still being written because the file is so large (7-10MB). I get an error: The process cannot access the file 'c:\TestDocs\XMLFiles\492172.XML'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.