Hi Lewis,
we have already this in a way; Pharo provides the permissions as per
stat in fact, but probably not the uid/guid of the file which would
allow for a real check of the permissions.
(that is, the current (wrong) situation is that isReadable returns
ownerCanRead, which has a strong chance of being wrong for a directory
owned by root, as you can guess)
As you can see, I was wrong in asking for stat/fstat... But thanks for
the info.
Thierry
Le 02/07/2013 16:32, David T. Lewis a écrit :
On Tue, Jul 02, 2013 at 04:05:18PM +0200, Camillo Bruni wrote:
On 2013-07-02, at 16:05, Goubier Thierry <[email protected]> wrote:
Le 02/07/2013 15:49, Goubier Thierry a ?crit :
Done:
SLICE-Issue-11102-FileSystemError-Path--root-ThierryGoubier.1
In http://ss3.gemstone.com/ss/PharoInbox
(It's for 2.0 at the moment. I'll try on 3.0 to port the same code).
Oh, it has a problem with utf8 :(
and most probably it won't work under OSX.
I think you have to implement these primitives on the different platform
specific stores,
that implies a separate version for win/mac/linux
Both the concept and the implementation will be different on Windows,
but for Unix and OS X you can use this for reference:
UnixOSProcessPlugin>>primitiveFileStat
"Call stat(2) to obtain the file protection mask for a file. Answer
errno on failure,
or on success answer an array with: UID with: GID with: protectionMask.
The
protectionMask is an Array of four integers representing the protection
mask, or
answer errno on failure. The protection mask is four Integers, each of
which may
be considered an octal digit (0-7), with bit values 4, 2, and 1. The
first digit selects
the set user ID (4) and set group ID (2) and save text image (1)
attributes. The second
digit selects permissions for the user who owns the file: read (4),
write (2), and
execute (1); the third selects permissions for other users in the
file's group, with
the same values; and the fourth for other users not in the file's
group, with the
same values."
For example:
OSProcess accessor fileStat: '/etc/hosts'
Dave
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95