file permissions

Gareth Rosson

New Member
Running Progress V8 on NT4, I am trying to check if I have write permission for an external file before opening it. However file-info:file-type always seems to contain a "W" even when I don't have write access.
Does anyone know of another way of checking this ?
 

bendaluz2

Member
The reason that this doesnt appear to work is because it IS checking the file attributes, i.e. whether the file is marked read-only or not. Not whether a particular user has permission to write to the file, which is what i suspect you really need to find out.
 
Of course, that makes perfect sense. So what is really needed is some method of verifying security access, not just examining the file read-only attribute.
 
I consider this to be strange behaviour!

I'm not interested in whether the file is marked read only - I am only interested in what I can do with that file.

In the wonderful world of Unix Character environments, when I ask if a file is writable it knows I mean "is it writable by me".

Sorry - This seems EXTREMELY strange!
 

Gareth Rosson

New Member
Resorted to a progress solution in the end
where v-file is the file I may not have permission to write to

OUTPUT TO VALUE(v-filepath).
RUN open-file (v-file).
OUTPUT CLOSE.
OS-DELETE VALUE(V-FILEPATH).

IF RETURN-VALUE = 'OK' THEN LEAVE.

PROCEDURE open-file:

DEF INPUT PARAM p-file AS CHAR.

OUTPUT STREAM dump-stream TO VALUE (p-file) APPEND.

RETURN "OK".
END.
 
Top