On 2013-07-02, at 15:11, Goubier Thierry <[email protected]> wrote:
> Le 02/07/2013 15:02, Camillo Bruni a écrit :
>> 
>>> Le 02/07/2013 11:44, Sven Van Caekenberghe a écrit :
>>>> Hi Thierry,
>>>> 
>>>> On 02 Jul 2013, at 11:34, Goubier Thierry <[email protected]> wrote:
>>>> 
>>>>> Hi all,
>>>>> 
>>>>> it seems FileSystem permissions are not working at all like intended in 
>>>>> Linux, and it's the case in both 2.0 and 3.0 (but it 3.0 it has the 
>>>>> elegance of rendering the file browser and all file dialogs unusable :().
>>>>> 
>>>>> https://pharo.fogbugz.com/f/cases/11102/FileSystemError-Path-root
>>>>> 
>>>>> (an entry like drwx------ 10 root root 4096 mai   15 13:26 /root is 
>>>>> readable according to FileReference :()
>>>>> 
>>>>> Is there any point in the vm to do a fstat/stat ?
>>>> 
>>>> I think the basic information is there, see 
>>>> FileSystemDirectoryEntry>>posixPermissions. It seems that the way that 
>>>> information is subsequently handled in Pharo is wrong, or at least way too 
>>>> simple. The question is of course, what is a good cross platform API. Mac 
>>>> OS X & Linux will be quite similar, but Windows ?
>>> 
>>> No, it's not. There are no primitives I could see in FilePlugin (at least 
>>> the ones used) to write correct permissions in Pharo... In short, no 
>>> isReadable, isWriteable can be made correct in Pharo at the moment.
>>> 
>>> I wrote test code expecting this to work :(
>> 
>> 
>> nope there is indeed no code for this.
>> We modified the VM to support the permission reading, but we didn't add 
>> support for writing it.
>> 
>> Maybe this is again a nice usecase for NativeBoost?
> 
> I'm ready to try. Anybody to explain me how to use NativeBoost for that?

You can check the OSEnvironment classes, they use getenv / setenv to accomplish 
simple callouts.

But I think fstat is more complex than that since it returns a struct and pass 
in 
the proper file descriptors :/...

As an immediate ver short term solution under linux I suggest using OSProcess + 
a chmod call :(

Reply via email to