Troubleshooting
Problem
- < (less than)
- > (greater than)
- : (colon)
- " (double quote)
- / (forward slash)
- \ (backslash)
- | (vertical bar or pipe)
- ? (question mark)
- *(asterisk)
FROM TABLE (
QSYS2.IFS_OBJECT_STATISTICS(
START_PATH_NAME => '/', OMIT_LIST => '/QSYS.LIB /QNTC /QFILESVR.400 /QOpenSys', SUBTREE_DIRECTORIES => 'YES')
)
WHERE PATH_NAME LIKE '%\%'
OR PATH_NAME LIKE '%<%'
OR PATH_NAME LIKE '%>%'
OR PATH_NAME LIKE '%|%'
OR PATH_NAME LIKE '%*%'
OR PATH_NAME LIKE '%:%'
OR PATH_NAME LIKE '%?%';
Diagnosing The Problem
Resolving The Problem
If the original application is not available or it is not able to remove these objects, there are some other options that can be used. These options include EDTF, FTP, Qshell, Access Client Solutions (ACS) Integrated File System function.
$
> mkdir /tmp/testdir
$
> cd /tmp/testdir
$
> touch '\testfile.txt'
$ 

EDTF STMF('/tmp/testdir')
Use option "4=Delete File" to delete files or option "9=Recursive Delete" to delete a directory and its contents.
FTP:
FTP can be used to rename or delete files and directories with invalid names that contain only standard ANSI characters. For example, FTP can be used to delete or rename files with names containing a backslash ('\'), but cannot handle names with embedded nulls or Unicode characters.
FTP Commands: REN (rename) and DEL (delete) for files, RMDIR (remove directory) for directories.
Note: Directories must be empty before they can be removed with the RMDIR command.
Note: An FTP session can be started either from the IBM i Command Line (on the same IBM i system or on a different IBM i system) or it can be started from a PC DOS Command Prompt.
| 1. | To start an FTP session to the IBM i system, on the operating system command line type the following command: FTP <systemname> Press the Enter key. You are prompted to sign on and type your password. |
| 2. | Once signed on, change the naming format from operating system to UNIX by issuing the NAMEFMT 1 command (quote site namefmt 1, and press the Enter key). The FTP session will respond with 250 Now using naming format "1". |
| 3. | To change to the directory containing the file in question, type the following: cd /tmp/testdir Press the Enter key. Response from the IBM i system should be 250 "/tmp/testdir" is current directory. |
| 4. | Type the following: DEL \testfile.txt Press <Enter>. The response is 250 Deleted file /tmp/testdir/\testfile.txt. This also works with the RENAME command. |
Note: Due to UNIX naming format, file names are case-sensitive.
The same steps may be used for removing directories with invalid names (such as \MYDIR). To do so, follow the steps above substituting the RMDIR command in place of the DEL command used in the example. If the directory which has the invalid character in the name contains other DIRs or STMFs, you will probably need to do a REN on the directory with the invalid character in the name and give it a valid name. At this point, you can use normal methods to delete the contents of the directory and remove it as you normally would.
Qshell:
Qshell can be used to remove some invalid file names, including those that contain a backslash as part of the name. To remove a name with a backslash, escape the character with an additional backslash or place quotes around the name.
Example: To remove "myfi\le" use 'rm myfil\\le' or 'rm "myfi\le"'
To use Qshell to remove the files, do the following:
| 1. | From an operating system command line, type the following: STRQSH |
| 2. | To change directory to the directory containing the invalid file name, type the following: cd mydir |
| 3. | To remove the file, type the following: rm "invalid file name" |
| 4. | Press F3 to end Qshell. |
QP0FPTOS API:
1) CALL QP0FPTOS PARM(*DUMPDIR '/path/to/directory')
CALL QP0FPTOS PARM(*DUMPDIR '/path/to/directory' *PRBONLY)
The '/path/to/directory' must be specified in the current job CCSID. These invocations will dump the contents of the specified directory to a spooled file. The spooled file will contain each link name in the current job CCSID and a hexadecimal representation of the link name in CCSID 1200 (UTF-16). Certain entries may also indicate that a "problem" exists for the link name. A link name contains a "problem" if it contains any of the following:
- Characters that cannot be converted to the current job CCSID
- Slash (/)
- Backslash (\)
- Asterisk (*)
- Question mark (?)
- Single-quote (')
- Double-quote (")
- Tilde (~)
- Colon (:)
- Space ( )
If the optional third parameter is omitted, all entries in the directory will be dumped to the spool file. Entries that contain problems can be found by searching for the string "PROBLEM:". If *PRBONLY is specified as the third parameter, only entries containing problem characters will be dumped to the spool file.
2) CALL QP0FPTOS PARM(*RENAME 'old-hex-name' 'new-name')
This invocation will rename a link in the current working directory. The 'old-hex-name' is the hexadecimal representation of the name in CCSID 1200 (UTF-16) that is obtained from the *DUMPDIR output. In the *DUMPDIR output, this representation is titled 'UNICODE' rather than 'HEX'.
The 'new-name' is a name specified in the current job CCSID. For example, if directory '/A/B' contained a link name with slashes, '/C/D', the following commands could be used to rename the link to 'NEWNAME':
CHGCURDIR DIR('/A/B')
CALL QP0FPTOS PARM(*RENAME '002F0043002F0044' 'NEWNAME')
3) CALL QP0FPTOS PARM(*RENAMEPRB '/path/to/directory')
This invocation will rename all entries in the specified directory that contain the slash (/) character. All of the slash characters in the names will be changed to hyphens (-). For example, if directory '/A/B' contained several link names with slashes ('/C/D', '/E', '/F/G/H'), the following command could be used:
CALL QP0FPTOS PARM(*RENAMEPRB '/A/B')
When the command completed, the problem names would be '-C-D', '-E', and '-F-G-H'. These names can then be easily removed or further renamed through other normal interfaces. The command generates a spooled file where the success or failure of file system operations is reported.
Related Information
Historical Number
15234725
Was this topic helpful?
Document Information
Modified date:
23 November 2025
UID
nas8N1019639