| View previous topic :: View next topic |
| Author |
Message |
whizzy General User

Joined: 14 May 2005 Posts: 42
|
Posted: Sun May 22, 2005 6:23 am Post subject: file privlidges |
|
|
Hi
I'm using the SimpleFileAccess method to check if a file is readonly on a linux system.
The file in question is "-r-xrwxrwx simon work filemame"
I don't own the file but I am a member of the group work.
The isReadOnly element of SimpeFileAccess return FALSE.
I believe this is the case because it only looks at the owner information of the file.
Is it possible to make SimpleFileAcess look at any of the 3 sets of privlidges ?
Does anyone know of a basic command or linux command that I could shell to identify to my macro that the file is readonly.
Regards
MARK |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3531 Location: Hamburg, Germany
|
Posted: Sun May 22, 2005 7:04 am Post subject: Re: file privlidges |
|
|
| whizzy wrote: | The file in question is "-r-xrwxrwx simon work filemame"
I don't own the file but I am a member of the group work. |
I think that you don't interpret the privileges correctly. IMHO your posted line means:
- user simon has read and execute rights
- group work has read, write and execute rights
- everyone els has read, write and execute rights
| whizzy wrote: | | The isReadOnly element of SimpeFileAccess return FALSE. |
Seems to be correct regarding my interpretation. You have to be simon to get TRUE.
With kind regards
hol.sten |
|
| Back to top |
|
 |
whizzy General User

Joined: 14 May 2005 Posts: 42
|
Posted: Sun May 22, 2005 10:33 am Post subject: |
|
|
Correct.
But when I run the macro under another user in the group work the same file is identified as not readonly.
I need to identify this file as readonly, how ????
Is there a basic command that can return the readonly status of a file by looking at the group privs as well as the user privs. |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3531 Location: Hamburg, Germany
|
Posted: Sun May 22, 2005 11:49 am Post subject: |
|
|
Correct what?
| whizzy wrote: | But when I run the macro under another user in the group work the same file is identified as not readonly.
I need to identify this file as readonly, how ???? |
But it is not read only! It is only read only if you are Simon.
| whizzy wrote: | | Is there a basic command that can return the readonly status of a file by looking at the group privs as well as the user privs. |
Isn't it easier to change the privileges than to disregard them?
With kind regards
hol.sten |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
|