Hi Booth,
On 12/11/2016 6:24 PM, Booth Martin wrote:
1. The definitions I see when I use WRKLNK do not align with the
   definitions I see  when I look at the same files with Filezilla.
Can you elaborate on that?  I don't use FileZilla very often, what does 
it show you that does not match?
2. It appears that web pages populated with .json data need a user of
   QTMHHTTP, and sometimes QTMHHTTP1. I see no way to make that happen
   within an RPG program?
They don't need to be owned by these profile, just accessible to them. 
Since these profiles are the DEFAULTS for the HTTP server, if they are 
accessible to these profiles they are also accessible to everyone in the 
world that can access your HTTP server.
As such, security isn't really a concern here.  Just make them publicly 
accessible.
3. I am confused as to the use for *R authority.  When/where would I
   have an occasion to use *R authority?
This is a weird question. *R means "readable".  Are you saying that it's 
unusual for your users to need to be able to read data from a file?!
4. If a program that deletes and creates a file is run by User Bob and
   then the next day is run again by User Suzy, what happens?  Does the
   file choke on seeing Suzy's name?  Does it run, creating the new
   file but saving the original file settings, or is User Suzy the
   owner until User Next runs the program?
Unless changed, the owner is the person who created the file.  If you 
are deleting and re-creating a file, that will change the owner because 
you are re-creating it.
It does not "choke" on another using accessing the file, however, unless 
you've set the permissions such that only the owner can access it.
Scott Klement's 1241-line IFSIO_H is well documented and complete but in
the end boggled my mind to the point of confusion. Comparing it to the
alphabet, I am at the A-B-C stage, looking to get to D and maybe, one
day, even to  E & F.
It's meant to provide you with the definitions you need to use in your 
program. It is a copy book, not an instruction manual.
You didn't actually ask how to code your open() call in order to get the 
permissions you need...  but I suspect that this is eventually what all 
these questions add up to.
1) In most situations, I would recommend using O_INHERITMODE as one of 
the flags (2nd parameter) to the open() API.  This tells it to get the 
permissions from the directory, which simplifies administration since 
the administrator can just set the directory permissions and the files 
within are automatically given that permission.  When you use this flag, 
set the mode parameter to 0.
2) In situations where you want to override the directory permissions, 
do not specify O_INHERITMODE, but instead specify the permissions in the 
mode parameter.  If you want to make it readable to everyone (seems to 
be the case in this e-mail) you probably want to use soemthign like 
S_IWUSR + S_IRUSR + S_IRGRP + S_IROTH -- this makes it read/write for 
the owner only, and read for everyone else.  If you want it to be 
read/write for everyone, do S_IWUSR + S_IRUSR + S_IWGRP + S_IRGRP + 
S_IWOTH + S_IROTH.
The way to read these S_xxxx flags is by looking at the last 4 letters. 
So S_IWUSR last 4 chars is WUSR which is short for (W)rite USR (User). 
User = Owner of the file (aka user who created it)
So WUSR = Write/Owner, RUSR = Read/Owner.  WGRP/RGRP = Read or Write 
Group, ROTH/WOTH = Read or Write for "Other" (Other = Public)
-SK
As an Amazon Associate we earn from qualifying purchases.