MC Press Web Site Staff
** This thread discusses the Content article: Tips and Techniques: Does Your File Exist on the IFS?0
Guest.Visitor
** This thread discusses the Content article: Tips and Techniques: Does Your File Exist on the IFS? **
Bob- Your 4/21 article describes the use of F_OK as the second parameter of the access() procedure, and mentions the other allowed values R_OK and C_OK but does not identify their meaning nor use. ?? (Perhaps that was intentional, so that readers would have to search further themselves?)
buck.calabro@commsoft.net
The access() function is documented in the Unix IFS API manual. In essence, every C/Unix API has it\'s prototype defined as a /copy member (C calls them \'include files.\') The documentation always tells you what include file you need. In the case of access(), it is unistd.h. OS/400 has a funny way of naming these include files. They are in library QSYSINC (if you have the System Openness Includes loaded. They\'re free.) The \'h\' files, are in source file H. The \'sys\' files are in source file SYS. The member names match the file name, so you can find unistd.h in QSYSINC/H MBR(UNISTD). There, you\'ll find the descriptions of the constants used by the function. #define R_OK 4 /* Test for read permission */ #define W_OK 2 /* Test for write permission */ #define X_OK 1 /* Test for execute or search permission */ #define F_OK 0 /* Test for existence of a file */ IBM Toronto\'s Barbara Morris has posted an excellent article on converting C data types to RPG. It comes in handy when trying to decipher these include files. http://www.opensource400.org/callc.html The RPG Redbook has a brief tutorial and some worked examples. http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245402 .html?Open --buck
Guest.Visitor
maryellen.desforge wrote: > Bob- Your 4/21 article describes the use of F_OK as the second > parameter of the access() procedure, and mentions the other allowed > values R_OK and C_OK but does not identify their meaning nor use. ?? > (Perhaps that was intentional, so that readers would have to search > further themselves?) Maryellen, A DogPile.com search for those constants gives this page: http://www.nag.co.uk/nagware/NP/r41_doc/f90_unix_file.html Their meanings are as follows: F_OK = File Existence R_OK = File Readability Check (can it be accessed) W_OK = File Writability Check Bill
kevin@pibf.org
Thanks for the aritcle. Very useful since I\'m having to move some files from the QDLS file system to the root file system.
Please login to make comments.
User Rating: / 0
PoorBest 

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM