![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhh_DSuIFUEX7uR8ctLzSmnCg2Ubkv8msxdbK9vIr0yFYNnHiYhvjBsT9gCADdudq2VIpsO4dY0LZm-4JebM1arLNN4J9QJJTtQmWUW_abZC9rOPIjwDOCrtsRTwDFsHIupc8JyiOg-ZcaP4Z0uT66IhXSs2Y4_cW6Whqj9vExWWe_hYJta3R1h4gcvl0/s200/sql.png)
While it has been possible to compare the contents of two directories in the IFS it has not been, well, simple. A new addition to Db2 for i, SQL, in the latest round of Technology Refreshes, IBM i 7.5 TR4 and IBM i 7.4 TR10. Makes it a whole lot, well, easier.
The new SQL Table function, COMPARE_IFS uses the output from the Table functions IFS_OBJECT_STATISTICS and IFS_OBJECT_PRIVILEGES to compare the objects in two IFS directories to one another. It will only check the following object types:
- Character special files, *CHRSF
- Directories, *DIR
- Name pipes, *FIFO
- Local sockets, *SOCKET
- Stream files, *STMF
- Symbolic links, *SYMLNK
I created two subfolders within my home directory, /home/MyDir, called subdir1 and subdir2. I uploaded some files into each one. Some were the same files, others were different files, and some files had the same names but different contents.