2

I am new in uniVerse and I have to write a uniVerse program which will check permissions of folders,subfolders and files. for example we have a folder called A and subfolder A1 and files in A1. now have to check if their permissions are set correctly.

lets say files on subfolder A1 are supposed to be rwxrwxr-x (775) but they are rwxrwxrwx(777). then based on this I need to report to say files on folder A1 are not set correctly.

well so far a little push/ideas/references/code snapshots etc would really help.

Thanks a mill in advance for help.

TMAN-MAN
  • 141
  • 1
  • 2
  • 13

2 Answers2

2

I'm more of a UniData person but in UniVerse Basic it looks like you could leverage the STATUS command which returns a dynamic array that contains the UNIX permissions in numeric form (e.g. 777).

More information available in the UniVerse Basic reference manual here: http://www.rocketsoftware.com/u2/products/universe/resources/technical-manuals/universe-11.1.11-documentation/basicref-v11r1.pdf

1

One of the best resources for UniVerse and RetrieVe questions is this site: http://www.mannyneira.com/universe/

If your system allows it, you should look into trying to write a script that executes via Shell. You can write UniVerse scripts that duck in and out of Shell. According to the UniVerse and Linux page on that site, you should be able to access it via the SH command.

When writing a Shell program to interact with UniVerse, you're typically going to want to use uvsh to output the data and then pipe it to something else (such as col) to manipulate it. If you pass a string to the uvsh command, it will execute it - so you can pass it commands to read file data (such as from voc pointers).

Keep in mind that every time you run the SH or uvsh command, you're nesting another shell within your current one, not switching between them.

However, it sounds like the file permission information you're interested in could be handled purely on the Shell side of things...

Corion
  • 663
  • 3
  • 14