OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

file privlidges

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
whizzy
General User
General User


Joined: 14 May 2005
Posts: 42

PostPosted: Sun May 22, 2005 6:23 am    Post subject: file privlidges Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Sun May 22, 2005 7:04 am    Post subject: Re: file privlidges Reply with quote

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
View user's profile Send private message
whizzy
General User
General User


Joined: 14 May 2005
Posts: 42

PostPosted: Sun May 22, 2005 10:33 am    Post subject: Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Sun May 22, 2005 11:49 am    Post subject: Reply with quote

whizzy wrote:
Correct.

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
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Mon May 23, 2005 8:42 am    Post subject: Reply with quote

I don't see a simple way to do that.
You can launch a shell command "ls -l yourNameFile" and parse the result. Hope there is a straightforwarder way but don't know it.
See
Call an external program with macro http://www.oooforum.org/forum/viewtopic.phtml?t=6117
shell command - How do I see the results of my shell command http://www.oooforum.org/forum/viewtopic.phtml?t=9503
using shell command in Openoffice version 1.1.4 http://www.oooforum.org/forum/viewtopic.phtml?t=19972&highlight=
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group