We, as I imagine everyone, have an accumulation of files of many types sitting on the IFS in company/user defined folders. Most of ours are PDF's and spreadsheets from program output that has been emailed. Some sit there and are 'refreshed' every time the program runs. Others are test files and maybe reports that were 'one timers' or not used anymore.
I would like to be able to find the unused files, move them to another folder, save to tape and finally delete them. We are at VR4M0.
What are some of the methods used for purging/deleting old files from the IFS programmatically?
Thanks,
Nick
Software/Hardware used:
AS400 V5R4M0
ASKED:
December 2, 2011 9:34 PM
UPDATED:
February 28, 2012 3:46 PM
Other than products for the purpose, I don’t think I’ve seen anything. It’s not excessively difficult to write a recursive directory traversal procedure. The opendir(), readdir() and closedir() APIs are reasonably easy. The stat() API returns any date/time info needed to decide how to process the entries that are read.
At least one alternative to coding the logic is to use the Qp0lProcessSubtree() API can be used, but the logic can be easier to code. One tricky difference is that Qp0lProcessSubtree() will present entries in a depth-first fashion. That can be difficult to code if you do it yourself, and can be handy for purge functions. But the API can also take some practice to get under control.
Tom