Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion File stat info
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Sugalski  
View profile  
 More options Apr 28 2004, 11:56 am
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Wed, 28 Apr 2004 11:56:42 -0400
Local: Wed, Apr 28 2004 11:56 am
Subject: File stat info
As part of the great "clean up the dangling bits" sweep...

File stat stuff. Let's do:

    stat [PINS]x, Sy, Iz
    stat Px, Sy

where Y is the filename. Z is the stat element, and X is the value
for that element. (In the two-arg case it's an array PMC, where the
offset matches the element number in the three arg case) Whether an
element returns a string, int, or float depends on what it is.

The returned PMC in the two-arg case could be a hash/array pmc and
allow string-keyed access to elements. If we do that, then the names
correspond to the constant names that follow.

NAME            Filename, no extension or path
EXTENSION       File extension
PATH            File path
DEVICE          Device file is on
SIZE            Filesize
ISDIR           True if is a directory
ISDEV           True if is a device
CTIME           Creation time
MTIME           Last modified time
ATIME           Last accessed time
BTIME           Last backup time
OWNER_READ      True if owner can read
OWNER_WRITE     True if owner can write
OWNER_EXECUTE   True if owner can run
OWNER_DELETE    True if owner can delete
GROUP_CD        True if owner can enter this directory
GROUP_READ      True if group can read
GROUP_WRITE     True if group can write
GROUP_EXECUTE   True if group can execute
GROUP_DELETE    True if group can delete
GROUP_CD        True if group can enter this directory
SYSTEM_READ     True if system/root/admin can read
SYSTEM_WRITE    True if system/root/admin can write
SYSTEM_EXECUTE  True if system/root/admin can run
SYSTEM_DELETE   True if system/root/admin can delete
GROUP_CD        True if group can enter this directory
OTHER_READ      True if anyone can read
OTHER_WRITE     True if anyone can write
OTHER_EXECUTE   True if anyone can run
OTHER_DELETE    True if anyone can delete
GROUP_CD        True if anyone can enter this directory
UMASK           System bitmask for privs
ACL_LIST        An array PMC with the ACL list for this file

If there's stuff missing, let's add it to the list, then we can
assign numbers and appropriate return types.

I can see adding in a separate op for priv testing on files, something like:

    canI Ix, Sy, Iz

where X is true or false, Y is the file, and Z is read, write,
execute, delete, or cd, so we don't have to figure out a way to walk
ACL lists when all we want to know is "Can I write to the damn file
or not?" and leave it to the system to sort out the privs there.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.