IBM Support

Integrated File System (IFS)

News


Abstract

List of GitHub Gists by Scott Forstie and iSee video tutorials by Scott Forstie and Tim Rowe related to Integrated File System

Content

You are in: IBM i Tutorials, Demos, and SQL examples > Integrated File System (IFS)
GitHub Gists Topic
IFS breakdown objects by subdir.sql
Someone asked if you could count the stream file objects, by directory. This solution gets the job done and includes the total size count as well.
Number of objects in a directory
Spreadsheets and Emails with SQL & ACS.sql
In this Gist, I show how you can leverage ACS's jar that is shipped on your IBM i to do your bidding. In this case, we can automate the creation and downloading of a spreadsheet to an IFS file where the contents of the spreadsheet is controlled with an SQL query. After the spreadsheet is created in the IFS, we use SQL once more to email the spre…
Save spreadsheet
Bringing order to the IFS.sql
This example picks on the IFS stream files found within and under the /tmp directory. How much gunk has been accumulated under /tmp and what can you do to manage it? A bit of SQL to the rescue. The IFS_OBJECT_STATISTICS() UDTF returns many elements of data for you to leverage for improved management of the IFS.
Objects in /tmp directory
TopN user storage report.sql
This example takes a previous example and extends it. The idea here is that you want to proactively manage user consumption of storage. For the top storage consumers, return a report that lists their largest objects (either in QSYS or IFS) and provide some contextual detail. This solution includes simple controls to allow the caller to specify t…
Storage
Object ownership by user - total report.sql
This gist combines several IBM i (SQL) Services to produce an easy to consume UDTF. Pass in a user name and you'll get back all the QSYS and IFS objects they own, ordered by size descending.
Object ownership
Generating spreadsheets with SQL.sql
In this working example, we establish an SQL table which contains the spreadsheets we'd like to have generated. Each row in the table includes the query that will supply the data for the spreadsheet, and the location in the IFS where the spreadsheet should reside. Further, a different procedure emails the spreadsheets to an interested consumer. 
Save spreadsheet
Protect the IFS root for *PUBLIC
When an IFS directory includes W (write), you are exposed to malware attacks. Use this to review and overcome this topic for the all important ROOT directory.
Root directory write exposure
NetServer Shares and IFS path availability.sql
I was asked to show how SQL could be used to identify when IBM i NetServer is sharing IFS paths, but some of those paths are unavailable.
IBM i NetServer shares
IFS_search_replace_and_create.sql
I was asked how ifs_read and ifs_write could be combined to build a new IFS stream file, where certain character strings are replaced.
Editing a stream file
Extracting the IFS filename from an absolute path name.sql
The request was, if you have an absolute path, how can SQL extract the filename from the path? One approach is found below.
Extract Filename from path
Searching the IFS for objects with "log4j" in the name.sql
The request from a client was to provide an SQL approach to search all of the IFS, finding any object that has "log4j" in its name, and producing an SQL table with the search results.
Find objects using search phrase
Searching the IFS by name or date.sql
The request was to provide an easy to use and customize approach for finding files within the IFS based upon generic names and including the date they were created.
Find objects using search phrase or date
iSee Video Tutorials Topic
Manage your IFS with IBM i Services and ACS
With IBM i 7.3 TR8 and IBM i 7.4 TR2 there are many new IBM i Services that can really help make the management and understanding of your IFS easier. In this session we will look at some practical examples on how to better manage your Integrated File System (IFS) along with some new features to improve your experience with IBM i Access Client Solutions (ACS).
IBM i services for the IFS
How to Read from an IFS Object
The latest TR has delivered an intriguing new IBM i Service. Being able to read the contents of an object from IFS.  Well, technically, its not 2 service, but 3, Text, Binary, and UTF8, so basically, you have pretty much every option covered. In this session we are not only going to show you HOW to read the contents, but we will also give you some hands-on look at why this is a very interesting new service. 
IBM i services for the IFS
Write to a File in the IFS
In the last session we showed you how to read the contents of a file in the Integrated File System. So, naturally, it makes sense in this session to show how to write content to an object in the IFS. This video is a 3 part story: 1. Something simple, write all the names of every library to a file.  2. Generate some JSON and write that in UNICODE to a file. 3. Write your favorite SQL into a file that can then be run in an automated manner.
Write to IFS
Convert Spool files to PDF easy with SQL
There are many ways to convert spool files to PDFs.  Many are interactive though, which of course makes doing some in a scheduled or programmatic manner difficult!   There is NOW a easy solution to the issue, the Generate PDF helper function delivered in SYSTOOLS.  This means that now with a simple SQL statement you can find and convert spool files to PDF simple as pie.  In this session Scott and Tim show you this new tool with a live demo.
Spooled files
Find Object by Name in IFS
How do you find things in IFS ?  There is an amazing service for this.  In this iSee we give/show you how to search the IFS for a specific object name.  This was made important by the recent security issue sounding Log4J.  This iSee will show you how to find all reference to this in your IFS.  Help you identify applications that need to be resolved. 
Finding objects
iSee What Jobs are using the IFS?
Recently, we had an IBM i administrator ping us with a request from an Auditor. They needed to find out all the jobs on the system that were using the IFS, and then of course more specially, what in the IFS! So Scott dove into his toolbox of SQL services to answer this question and more!  This iSee looks at the active jobs and IFS and shows some pretty interesting details.
IFS jobs
iSee Who is Actually Using an IFS Directory
The IFS is largely a mystery to many. In this session we will help you unravel a piece of that mystery. The question was presented to us, ‘Can I find out WHO is actually using and accessing directories in IFS?’  The answer of course, YES!!!  Starting in IBM i 7.4, the operating system added a feature,  Authority Collection for Objects.  Leveraging this and a few simple SQL statements, you can get a full access log to every user that has touched an IFS directory for any reason.
IFS users

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Document Information

Modified date:
01 December 2023

UID

ibm16340285