|
Hi Rob, > Whereas a cpytoimpf does NOT adopt the authority of the directory that you > place the object in, (unlike ftp, netserver, etc), is there a command like > GRTOBJAUT to use a reference object? If you only need the owner & permissions bits set, you could write your own utility to do this using the IFS APIs... stat(), chown(), chmod(). Unfortunately some of the iSeries-specific stuff (auth lists, MS-DOS compatible attributes, etc) would require the use of Qp0lGetAttr() and Qp0lSetAttr() which, IMHO, are really ugly APIs that are very difficult to use. Still possible, though... Another thing that pops into mind is "cp -p" in QShell. The -p switch to the "cp" utility in QShell is used to maintain a stream file's permissions, owner, etc when copying it. So, if you type: cp -p reffile newfile Newfile will be a duplicate of reffile, and if possible it'll be granted the same authorities. (IF you don't have enough access to assign those file permissions, it'll just have the default permissions...) What makes this interesting for your scenario is that CPYTOIMPF will not change the authority if the file already exists, it'll just replace the data... So, you could create an EMPTY file with the permissions you want to use... (You can create an empty file in QShell with the "touch" utility) then use "cp -p" to make a new file with the right permissions, followed by CPYTOIMPF to fill it with data. A bit kludgy, perhaps...
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.