Home > AS/400 Tips > iSeries administrator tips > Cleaning up unused or temporary IFS files -- Part 1
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Cleaning up unused or temporary IFS files -- Part 1


Ron Turll
10.12.2005
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



[TABLE]

Much of the Integrated File System (IFS) operates as a sort of mixture of DOS, UNIX and OS/400 (i5/OS). The Work with Object Links (WRKLNK) command is reminiscent of the DOS DIR command, although the concept and mechanics of "hard" and "symbolic" links come directly from UNIX. The object types (e.g., directories, stream files, sockets, etc.) and the way they are accessed programmatically are characteristic of both DOS and UNIX. Then there are the peculiarities of the IFS that would have to be attributed to the influences of IBM and OS/400. All in all, it is not a bad system -- just a little quirky with its multiple personalities.

One influence from the common-sense arena that unfortunately did not make it into the IFS is the use of selective deletion. Actually, OS/400 has a type of selective deletion. You can delete objects by type only by specifying the corresponding delete command. For example, to delete a file you must use the DLTF command, to delete a program you use the DLTPGM command, and so forth.

Deleting IFS files
Deleting objects in the IFS is a simpler process: You use the Remove Link (RMVLNK) command from OS/400-i5/OS. You can also delete objects in the IFS from other systems, like an attached PC using Windows Explorer. However, there is no mechanism on the iSeries that allows you to selectively delete IFS files based on certain criteria, such as the file type or, in the example we'll be discussing, the number of days the file has been unused.

[TABLE]
[IMAGE]

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


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
iSeries administrator tips
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i
Translating Linux for IBM i admins: User profile commands
Modern System i reports using Client Access
Tips for installing Lotus Domino server on a System i partition
The iSeries Blog has a new home on IT Knowledge Exchange
Virtualization for IBM i: Backups

Integrated File System (IFS)
Transfer files from one environment to another without closing all other AS/400 sessions
Securing the integrated file system on IBM System i
Generically send a text file from the IFS via FTP
Setting ILE and C+++ compilers to runtime
Use a virtual directory to move a .bmp file from the IFS to a remote server to run a software package
Backing up PDFs within the IFS on AS/400
FTP from AS/400 to PC folder
Copying the spool file stream to IFS
An automated CL method of moving a query from AS/400 to Excel
IFS folder error

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


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
The code for the command interface portion of our utility is shown below.

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.

-----------------------------------
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts