|
Thank Scott and Narayanan!You just turned lots of ugliness into a few lines! Just when I was having fun juggling dates in ILE!
Fritz Hayes Scott Klement wrote:
I didn't test this, but it should be fairly close. It deletes all files that haven't been accessed in 60 days (change -atime to -mtime if you want files that haven't been modified)STRQSH CMD('find /my/dir -atime +60 -exec {} \;')Or, you could do it this way... it runs faster, but is limited in the amount of files it can handle at once:STRQSH CMD('find /my/dir -atime +60 | xargs rm')Is calling QShell in this manner elegant? It depends on your point of view. It certainly is easy. Error handling isn't good, however. It requires QShel. Probably doesn't perform very well (especially the first option I listed).But, it's a lot easier than writing a tool that uses the APIs to do the same thing. (And then when you do write such a tool, someone else posts the QShell method and gets all the credit and gets told that his solution is better than the one that I worked hard to provide.)--- Scott Klement http://www.scottklement.com
<SNIP>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.