Library that you used for the "XXX" that I put in the comments.įor example, if your source library is called "TASTYSRC", you would type: CRTBNDRPG CH1HELLO SRCFILE(TASTYSRC/QRPGLESRC) DBGVIEW(*LIST) But, of course, you'll need to substitute the source You typed all of that already? Wow, that was quick, good job! The instructions at the ** API call to write data to a stream fileĬ* Create an empty file called 'helloworld':Ĭ callp write(fd: %addr(data): %size(data)) ** CRTBNDRPG CH1HELLO SRCFILE(xxx/QRPGLESRC) DBGVIEW(*LIST)
#IFS FILE CODE#
Type the following code into a source member called CH1HELLO, and we'll try to make it I'm a programmer! Lets go! Let's write some code, already! I don't know about you, but I'm falling asleep reading this book. You can even define your ownįile system that uses your own user-defined rules if you wish! (But, we won't be covering Special directory namesĪre used to denote which file system you're referring to. In the IFS, manyĭifferent file systems can be accessed using a common interface. Of these different rules, the Integrated File System (IFS) was born. In order to make OS/400 capable of working with files and folders that adhere to all
#IFS FILE WINDOWS#
Windows "MyFile.txt" and "myfile.txt" would refer to the same file, but in UNIX they And UNIX allows spaces and long filenames,Īnd even makes the distinction between upper & lower case letters.
#IFS FILE PLUS#
Longer file name, plus they now allow spaces. Windows extends the MS-DOS capability by adding the ability to have a much MS-DOS filenames can be 8Ĭharacters long with a 3-character "extension", and cannot contain spaces in theįilename. Some problems needed to be solved in order to do this, however, because although theseįile systems are all similar, they are not exactly the same. Words, their contents are not strictly defined by the operating system.Īt some point in it's history it was decided that OS/400 should be extended to work Pictures, sounds, video files, or anything else that a programmer can dream up. Write and read these bytes as data files, but they can also view them as programs, Systems where each object is simply a collection of bytes. Each object type has a strictly defined layout.įiles, for example, contain members, which then contain records, which contain fields.Įach of these pieces is given a strict definition of what it is, how it works, and how itīy contrast, other operating systems, such as UNIX, MS-DOS and Windows use file Within each library are objects that are assigned a specific "object type" Traditionally, we've worked with a file system on OS/400 that was made up of Example of Reading a directory recursively Example of making a DIR command for QSHELL 7.10. Example of writing & creating an ASCII textįile 5.7. Example of writing and reading text files 5.5. Reading text data from a stream file 5.4. Example of reading/writing/updating records in a streamįile 5. Calculating number of records in a file 4.5. Organizing a stream file into records 4.4. Example of using lseek() to jump around the file 4.3. Positioning to a given point in the file 4.2. Example of renaming and deleting IFS objects 4. Adding a *SAME option to the permission changer 3.7. Example of changing an IFS objects permissions 3.5. Changing permissions on an existing IFS Object 3.4. Example of checking for an object in the IFS 3.3. Checking existence and permissions to files 3.2. Other simple, but helpful IFS commands 3.1. Example of writing raw data to a stream file 3. Our last example with error handling added 2.8. Getting a human-readable error message 2.6.4. Example of writing and reading data to a stream file 2.6.
![ifs file ifs file](http://www.ifslogistics.ca/images/caro/image1.png)
Reading a stream file with the read() API 2.5. Writing streams with the write() API 2.4. Code snippet showing the use of the open() API 2.2. The return value of the open() API 2.1.8. IFS information in the Information Center 1.5. What different file systems can I work with in