Integrated File System Tools: DEL, DELTREE, CMDALL, CHGAUTALL, CHGOWNALL, QRYIFSLIB, DLTIFSF, RNMIFSF
This document describes the set of Integrated File System tools that are available for download from the IBM Technical Support Center FTP site.
Resolving the problem
This document describes the set of Integrated File System tools that are available for download from the IBM Technical Support Center FTP site. The tools are intended primarily for system administrators. They assist with common tasks such as recursively running a CL command against all files and subdirectories in a directory. Another tool dumps file and directory information into an externally described file. The output file can be used for a variety of purposes such as querying for disk space usage reports or processing by a CL program.
|Caution: The following tools are provided on an unsupported, as is basis. Having a current system backup is strongly recommended before using the commands that delete or change multiple files. When run recursively from root, some of these commands can affect all files on the system.|
Getting the Integrated File System Tools to your system
The tools are included in a save file named Ifstool.savf which is available at the ftp site, ftp://public.dhe.ibm.com/services/us/igsc/cs2/ApiSamples/ The save file is for the R450 operating system and later. The save file contain compiled program objects and source code for all of the Integrated File System utilities. No command wrapper is supplied for these objects. To download the file from the ftp server, click the link above or type it into a web browser then click on or drag and drop the file named Ifstool.savf to save it on your PC. If you use another method to download the save file, be certain to use a binary format for the transfer of the file. Then the save file needs to be uploaded to the iSeries. For detailed information on how to upload a save file to the iSeries, see Rochester Support Center knowledgebase document N1017325, Using FTP to Move a File in SAVF Format from a PC to a Library :
Once the save file data has been uploaded to the operating system, it can be restored using the command:
RSTOBJ OBJ(*ALL) SAVLIB(DDILLING) DEV(*SAVF) SAVF(IFSTOOLSF) RSTLIB(MYLIB)
Using the Integrated File System Tools
To display the help text for a program call the program with no parameters. For example:
where <pgmname> is the Integrated File System tools program name.
|ATTRIB||Note: OS/400 R510 and later and i5/OS R530 provide a CHGATR command with function similar to this tool. OS/400 R540 added a new SUBTREE *ALL parameter that allows it to run against all subdirectories (similar to the S switch on this command).
R450 and earlier do not have a native command to change or display certain file attributes such as read-only, hidden, PC archive, system, and ALWCKPWRT. The PC file attributes can be set only from a PC using a network drive connection.
The ATTRIB program works similar to the DOS ATTRIB command allowing the attributes to be updated from an operating system command line without requiring a network drive/PC connection. This uses the Qp0lSetAttr() API which is only supported in R440 and later.
CALL PGM(ATTRIB) PARM('-R' '-H' '/ddilling' '\S')
|CHGAUTALL||Runs the specified CHGAUT command recursively on all files and subdirectories.
Note: This function was integrated into OS/400 R540 using a new SUBTREE *ALL parameter on the CHGAUT command.
CALL PGM(CHGAUTALL) PARM('/rjzeller' 'USER(DDILLING) +
|CHGCCSID||Note: OS/400 R510 and later and i5/OS R530 provide a CHGATR command with function similar to this tool.
Change the CCSID on a particular file or all files in a directory. This will not convert the text.
CALL PGM(CHGCCSID) PARM('/ddilling/myfile' '1252' )
|CHGOWNALL||Runs the specified CHGOWN command on all files and subdirectories.
Note: This function was integrated into OS/400 R540 using a new SUBTREE *ALL parameter on the CHGOWN command.
CALL PGM(CHGOWNALL) PARM('/ddilling' 'NEWOWN(DDILLING) + RVKOLDAUT(*YES)')
|CMDALL||This program executes the specified command against each file and each directory in the target directory as well as all files and directories below those directories. The command is executed using the specified parameters. Any command that has an OBJ parameter can be used.
Note: In OS/400 R540, most commands allow this function using a new SUBTREE *ALL parameter.
Example: This examples runs the change primary group command against all directories and files in or below /test.
CALL PGM(CMDALL) PARM('/test' 'CHGPGP' 'NEWPGP(MYGRP) +
|DEL||Similar to the Windows DEL command or a recursive version of RMVLNK. Allows the user to specify wild card pattern match and, optionally, to perform the operation on all subdirectories.
CALL PGM(DEL) PARM('/ddilling/*.eml' '\s')
|DELTREE||Caution: Use this command with caution. There is no undelete.
Note: OS/400 R440 and later and i5/OS R530 include this function in the EDTF command; option 9=Recursive Delete.
Similar to the DOS DELTREE command. Deletes all files and directories and subdirectories from the parent directory down.
CALL PGM(DELTREE) PARM('/rjzeller')
|DLTIFSF||This program can be used to remove (delete) an IFS file that has a special character such as a backslash ("\").
CALL DLTIFSF '[filepath]'
|DSPLINK||Note: OS/400 R450 and later and i5/OS provide this function in WRKLNK DETAIL(*EXTENDED) Option 12.
Displays the location of the object a symbolic link refers to.
CALL DSPLINK '[filepath]'
|QRYIFSLIB||Note: IBM i5/OS R530 and later now provides similar function with the RTVDIRINF command.
Similar to QRYDOCLIB, this utility dumps all the lstat information for an Integrated File System object into an output file. The output file includes items such as allocated size, actual size, owner, modified date, last accessed date, group, and permissions. It also prints the total allocated size of each directory processed.
Note: The R440 version does not support large files (file size > 2Gig).
As with all of the tools, call the program with no parameters to display the help text:
Invalid number of arguments.
Dump stat info for each ifs object into outfile
QRYIFSLIB and, if \A option is selected, QRYIFSLIBA.
- This will not follow symlinks.
- The output file is overwritten on each call.
This utility is unsupported and provided on an as is
basis. Comments can be sent to email@example.com.
CALL QRYIFSLIB '[path/]*|file' ['\S'] ['\A'] ['\L:lib']
[path/] Absolute or relative path ending with a '/'.
* Process all files in a directory.
file Process only specified file system object.
\S Process all subdirectories.
\A Include native authority information.
\L:lib Library to write output files into (Default is QGPL).
\Q Skip /QSYS.LIB
Comma delimited list of directory names to exclude
where one directory name can be the special value
*NONLOCAL. *NONLOCAL is a wildcard for the following IBM
CALL PGM(QRYIFSLIB) PARM('/ddilling/myfile.txt' '\A')
CALL PGM(QRYIFSLIB) PARM('/ddilling/*')
CALL PGM(QRYIFSLIB) PARM('/ddilling/*' '\s')
CALL PGM(QRYIFSLIB) PARM('/*' '\s' '\X:*NONLOCAL,/ddilling')
|RNMIFSF||Rename a file in the Integrated File System. It can be used to rename files whose names include special characters not support by the REN command. One common example of an unsupported character is the backslash (\).
CALL RNMIFSF PARM('[filepathold]' '[filepathnew]'
Using IFSTOOL commands in a CL program or without a terminal session
The commands above print informational messages to a terminal session. They may also prompt the user for input or confirmation. The programs use STDIN and STDOUT streams for input and output.
To "hide" the terminal session, STDIN and STDOUT can be redirected to files using an override database file command. If the programs are run in batch, OS/400 will redirect STDOUT to QPRINT (a spool file) while STDIN will be redirected to QINLINE. See the section "STDIN, STDOUT, and STDERR" in the ILE C Programmer's Guide in iSeries Information Center for further information. The following example is a CL wrapper over DELTREE. It redirects the output to a file DELTREEOUT. The confirmation prompt is replied to by using a file DELTREE that contains one record with the data 'Y'.
/* DELTREECL example */
OVRDBF FILE(STDOUT) TOFILE(DDILLING/DELTREEOUT)
OVRDBF FILE(STDIN) TOFILE(DDILLING/DELTREEIN) +
CALL PGM(DELTREE) PARM('/ddilling/b')
/* Note that if a parm is passed to a one of these utilites */
/* a null must be added after the last character . */
/* See the CL Programming reference - the section on */
/* calling ILE C programs from a CLP - for further details. */
/* Example: */
/* DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00') */
/* CHGVAR VAR(&PATH) VALUE('/ddilling/b' *CAT &NULL) */
/* CALL PGM(DELTREE) PARM(&PATH) */
|Operating System||IBM i 6.1|
|Operating System||IBM i 7.1|
|Operating System||IBM i 7.2|
|Operating System||IBM i 7.3|
More support for:
Software version: 5.1.0, 5.2.0, 5.3.0, 5.3.5, 5.4.0, 5.4.5, 6.1, 6.1.0, 6.1.1, 7.1, 7.1.0, 7.2, 7.2.0, 7.3
Operating system(s): IBM i
Reference #: N1019580
Modified date: 21 November 2012