Some applications and utilities make ample use of the IFS for temporary files. You may find it efficient to have a way to automatically delete those temporary files. For example, you
'); // -->
may want to delete a file if it has not been used for, say, at least 15 days. A command like the following would do the trick: Such a command does not exist, so we will have make our own. Developing a DELIFSFILE utility Specify "DELIFSFILE" as the command processing program (CPP) when you compile the command. The CPP for the DELIFSFILE command can be found here. As indicated before, its name is also DELIFSFILE. Probably the first thing you will notice is that the code is in C. For many years, I have encouraged AS/400-iSeries professionals to get to know the C language. For many endeavors, C is a far superior language -- in both ease of coding and efficiency of the final program -- than any of the other languages on the iSeries. In years past, even though I had encouraged readers to learn C, I had refrained from publishing code in C so readers would not be forced to buy the C compiler. But ILE C/400 has been shipping as part of OS/400-i5/OS since V5R1, so most users now have the C compiler available. (ILE C/400 also comes with WebSphere, but that's another story.) The program uses the Qp0lGetAttr API to retrieve the usage attributes for the files in the IFS. This API requires some fairly complex data structure programming and is the main reason the C language is employed. (C's programming mechanisms for defining and manipulating data structures are simply the best.) We will discuss the code in detail in the next installment of this article. Until then, you may want to familiarize yourself with the Qp0lGetAttr API. -----------------------------------
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| iSeries Security - Security Tools, Physical Security and System Security |
| About Us | Contact Us | For Advertisers | For Business Partners | Site Index | RSS |
|
|
|
|||||||