Delete files from IFS based on last used age

85 pts.
Tags:
Application development
AS/400
I need a non-C program that will delete files from a directory and its subdirectories in the IFS based on a user specified number of days since the last time it was used. Does anyone have such a program or product (or a suggestion for the easiest way to accomplish this)?

Answer Wiki

Thanks. We'll let you know when a new response is added.

look at this RPG tool : http://jplamontre.free.fr/AS400/DSPIFS.htm

it walks IFS, can show data inside file. In the code, there is 3 calls to the ‘stat’ api :
rc = stat (pathdirs: myStat );
rc = stat64 (pathdirs: myStat64 );
rc = statvfs(pathdirs: myStatVFS );

here is one solution to your question: data returned by these stat procedure contains many information, the one you are interested is
st_atime
Time of last access
I am not in front of my SystemI5, so I don’t know what is the unit used in st_atime. It can be the number of seconds since epoch (1970-01-01-00:00:00:000000)

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • KevinBattreall
    We use TAATOOL (http://www.taatool.com/). The have command CVTIFS that builds a file for the IFS similar to the DSPOBJD file. I wrote a CL to read the file and delete the IFS files older than 14 days.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following