• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting File Date w/o Changing Access Tag

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We're looking at deleting all files on a unix file system that haven't been used in x amount of time. Here's the code we currently use in our jsp:



The problem on unix is, if you touch the files to get the file's load date, it changes the access timestamp for the file. I can't find anything on how to read the timestamp via Java/jsp without changing any of the file's underlying information.

Thanks for your help.

[ March 25, 2007: Message edited by: Pat Flickner ]
[ March 25, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has absoluely nothing to do with JSP. Moved to an appropriate forum.
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, the code is in my jsp and it didn't occur to me that this might not be a jsp question.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Putting aside the fact that in this day and age you shouldn't be putting any code at all in a JSP, if it isn't about JSP technology, which this clearly is not, it isn't a JSP question.
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I inherited the code, Bear, and to be quite honest, with the integration project and a myriad of real problems I've had to address, I haven't had the time to correct all past mistakes, although I have corrected quite a few. This one seemed very low priority considering the overhaul we've had to do. So if could you just ease up a teensy bit, I'd really appreciate it. I'm just looking for answers. If this piece of code were within a servlet -- which it will be eventually -- I would still have need of the answer. You will be pleased to know that a rewrite of this project, partly for the reason you very aptly point out.

Thank you for your help.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pat Flickner:
I can't find anything on how to read the timestamp via Java/jsp without changing any of the file's underlying information.

I would have thought that the lastModified() method just returned the last modified date, without changing anything else. Are you saying that's not the case in Unix?
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In unix, any time you get info about a file, it changes the access timestamp. I'm not sure if the lastModified() method does that without affecting anything else.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pat Flickner:
I'm not sure if the lastModified() method does that without affecting anything else.



Seems enough enough to test.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic