Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 8th, 2005, 7:01 AM   #1
bobrivers
Newbie
 
Join Date: Nov 2005
Posts: 3
Rep Power: 0 bobrivers is on a distinguished road
Delete File Before a Certain date

Is there any way to obtain the creation date of a file.

I am aiming to automate the deletion of files that were created before a certain date.

Is this possible?

Any help would be greatly appreciated
bobrivers is offline   Reply With Quote
Old Nov 8th, 2005, 7:08 AM   #2
sinix
Programmer
 
sinix's Avatar
 
Join Date: Nov 2005
Location: China
Posts: 47
Rep Power: 0 sinix is on a distinguished road
Send a message via MSN to sinix
depend on your OS,you can use API on windows or SystemCall on Linux.I just know there is ,don't know what is.
sinix is offline   Reply With Quote
Old Nov 8th, 2005, 7:13 AM   #3
bobrivers
Newbie
 
Join Date: Nov 2005
Posts: 3
Rep Power: 0 bobrivers is on a distinguished road
Having just posted the question I realised that a few technical details may be of use:

The script is written in a .bat file (windows scripting) and run a Windows 2000 machine

bobrivers is offline   Reply With Quote
Old Nov 9th, 2005, 10:24 AM   #4
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
Note: UNIX does NOT keep creation times for files.


http://heanet.dl.sourceforge.net/sou...-2.5-1-bin.zip

is the location for stat.exe for Windows. This gives you file time information.
There is no windows command line utility that gives you all the file information stat.exe can give.

Anyway, it's a start, but I don't see how you are going to write a DOS batch script that will identify files older than a certain date relative to today's date.
For example: files older than 30 days. Play with stat.exe and see if it can help you.
jim mcnamara is offline   Reply With Quote
Old Nov 10th, 2005, 4:43 AM   #5
bobrivers
Newbie
 
Join Date: Nov 2005
Posts: 3
Rep Power: 0 bobrivers is on a distinguished road
Thanks for the link. Just "installed" it and had a play it looks good.


Thanks Again
bobrivers is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC