Jump to content

Last modified file.


froglips

Recommended Posts

I am trying to figure out the best way to automatically find and then open, the last modified file in a directory (actually sub-directory. What I need to do is this. We have a daily status report, that we save every day, in a directory system which looks like this:DSR/2010/APRIL/30APR10docThe next day, we recall the previous day report (so we do not have to re-enter ongoing items, modify the report to reflect the past 24 hours status, and then save this to, in the case of the above example:DSR/2010/MAY/01MAY10.docAs you can see, not only the document changed, but also the location in the sub-directory.So, is it possible to automatically press a link or button, and have the computer find and open the last modified file in the overall directory (DSR) structure?Thanks to anyone who first understands my rambling, and second might be able to help me. Bobb

Link to comment
Share on other sites

This is not an HTML question. This is a server-side question. Do you have access to a server-side scripting platform, like ASP or PHP?When you say "last modified file", do you mean according to the naming conventions you explained above? or do you literally want to peek into the file system and check modification dates? Very different processes.

Link to comment
Share on other sites

This is not an HTML question. This is a server-side question. Do you have access to a server-side scripting platform, like ASP or PHP?When you say "last modified file", do you mean according to the naming conventions you explained above? or do you literally want to peek into the file system and check modification dates? Very different processes.
I might be able to use PHP or ASP but I must confess to not knowing either of these languages (future study). I want to actually look at the last modification date, figuring that would be the most consistent way to accomplish this task?Thanks
Link to comment
Share on other sites

Reading directories is not difficult if you've written code like that a few times. If you want to check what the file system considers the last modified file, you would have to be dead certain that someone hasn't come along and made a change to an older file. Depending on the server, you might also get into trouble if any of the containing directories ever got moved, since that might reset the modification date on ALL the files.If your naming convention is consistent, working from that should not be a problem, and would be more efficient. Just get today's date and look for a file with a name based on that date. If you can't find it, work backwards one day at a time.I guess your first step is deciding on a scripting language. FWIW, we have a lot of PHP users on this board. But there are certainly plenty of ASP users on lots of other boards.Then maybe you'll need to get a general sense of how a script is constructed. Just the basics. Then come back with a more specific question?

Link to comment
Share on other sites

Reading directories is not difficult if you've written code like that a few times. If you want to check what the file system considers the last modified file, you would have to be dead certain that someone hasn't come along and made a change to an older file. Depending on the server, you might also get into trouble if any of the containing directories ever got moved, since that might reset the modification date on ALL the files.If your naming convention is consistent, working from that should not be a problem, and would be more efficient. Just get today's date and look for a file with a name based on that date. If you can't find it, work backwards one day at a time.I guess your first step is deciding on a scripting language. FWIW, we have a lot of PHP users on this board. But there are certainly plenty of ASP users on lots of other boards.Then maybe you'll need to get a general sense of how a script is constructed. Just the basics. Then come back with a more specific question?
Many thanks for your time and help. I am going to do as you suggest, and then get back to the fourm when I have a better idea of what I might need to asked.Bobb
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...